<h3>Columns</h3>
<table class="table table-striped table-hover text-center">
	<tr>
		<th>Name</th>
		<th>Type</th>
		<th>Not null</th>
		<th>Primary key</th>
		<th>Default</th>
	</tr>
	{% for row in structure %}
		<tr>
			<td><code>{{row["name"]}}</code></td>
			<td><code>{{row["type"]}}</code></td>
			<td>{% if row["notnull"] == 1 %}✓{% endif %}</td>
			<td>{% if row["pk"] == 1 %}✓{% endif %}</td>
			<td><code>{{row["dflt_value"]}}</code></td>
		</tr>
	{% endfor %}
</table>

{% if foreign_keys %}
	<hr>
	<h3>Foreign Keys</h3>
	<table class="table table-striped table-hover text-center">
		<tr>
			<th>Column</th>
			<th>Reference</th>
		</tr>
		{% for key in foreign_keys %}
			<tr>
				<td><code>{{key["from"]}}</code></td>
				<td>
					<a href="{{prefix}}/table/{{key['table']}}">{{key['table']}}</a>.<code>{{key["to"]}}</code>
				</td>
			</tr>
		{% endfor %}
	</table>
{% endif %}
