{% extends 'table/page_with_secondary_tabs.twig' %} {% block content %}

{{table}}

{{ get_hidden_inputs(db, table) }}
{# Table header #} {% if show_column_comments -%} {%- endif %} {# @see table/structure.js, function moreOptsMenuResize() #} {% if not db_is_system_schema and not tbl_is_view %} {% endif %} {# Table body #} {% set rownum = 0 %} {% for row in fields %} {% set rownum = rownum + 1 %} {% set extracted_columnspec = extracted_columnspecs[rownum] %} {% set field_name = row['Field']|e %} {# For column comments #} {% set comments = row_comments[rownum] %} {# Underline commented fields and display a hover-title (CSS only) #} {{ extracted_columnspec['displayed_type']|raw }} {% if relation_commwork and relation_mimework and browse_mime and mime_map[row['Field']]['mimetype'] is defined %}
{% trans 'Media type:' %} {{ mime_map[row['Field']]['mimetype']|replace({'_': '/'})|lower }} {% endif %}
{% if show_column_comments %} {% endif %} {% if not tbl_is_view and not db_is_system_schema %} {% endif %} {% if not tbl_is_view and not db_is_system_schema %} {% set type = extracted_columnspec['print_type'] is not empty ? extracted_columnspec['print_type'] %} {% endif %} {% endfor %}
# {% trans 'Name' %} {% trans 'Type' %} {% trans 'Collation' %} {% trans 'Attributes' %} {% trans 'Null' %} {% trans 'Default' %}{% trans 'Comments' %}{% trans 'Extra' %}{% trans 'Action' %}
{{ rownum }} {% if row['Collation'] is not empty %} {{ collations[row['Collation']].name }} {% endif %} {{ attributes[rownum] }} {{ row['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} {% if row['Default'] is not null %} {% if extracted_columnspec['type'] == 'bit' %} {{ row['Default']|convert_bit_default_value }} {% else %} {{ row['Default'] }} {% endif %} {% elseif row['Null'] == 'YES' %} NULL {% else %} {% trans %}None{% context %}None for default{% endtrans %} {% endif %} {{ comments }} {{ row['Extra']|upper }}

{% trans 'Move the columns by dragging them up and down.' %}

{{ get_hidden_inputs(db, table) }}
    {# Work on the table #} {% if not tbl_is_view and not db_is_system_schema %}
    {{ get_hidden_inputs(db, table) }} {% if show_icons('ActionLinksMode') %} {{ get_image('b_insrow', 'Add column'|trans) }}  {% endif %} {% set num_fields -%} {%- endset %} {{ 'Add %s column(s)'|trans|format(num_fields)|raw }}   {# I tried displaying the drop-down inside the label but with Firefox the drop-down was blinking #}
    {% endif %} {% if not tbl_is_view and not db_is_system_schema and tbl_storage_engine != 'ARCHIVE' %}
    {% trans 'Indexes' %} {{ show_mysql_docu('optimizing-database-structure') }} {% if indexes is not empty %} {{ indexes_duplicates|raw }}
    {% for index in indexes %} {% set columns_count = index.getColumnCount() %} {% for column in index.getColumns() %} {% if column.getSeqInIndex() > 1 %} {% endif %} {% if column.getSeqInIndex() == 1 %} {% endif %} {% endfor %} {% endfor %}
    {% trans 'Action' %} {% trans 'Keyname' %} {% trans 'Type' %} {% trans 'Unique' %} {% trans 'Packed' %} {% trans 'Column' %} {% trans 'Cardinality' %} {% trans 'Collation' %} {% trans 'Null' %} {% trans 'Comment' %}
    {{ index.getName() }} {{ index.getType()|default(index.getChoice()) }} {{ index.isUnique() ? 'Yes'|trans : 'No'|trans }} {{ index.isPacked()|raw }}
    {{ column.getName() }} {% if column.getSubPart() is not empty %} ({{ column.getSubPart() }}) {% endif %} {{ column.getCardinality() }} {{ column.getCollation() }} {{ column.getNull(true) }}{{ index.getComments() }}
    {% else %}
    {{ 'No index defined!'|trans|notice }}
    {% endif %}
    {% endif %} {# Display partition details #} {% if have_partitioning %} {# Detect partitioning #} {% if partition_names is not empty and partition_names[0] is not null %} {% set first_partition = partitions[0] %} {% set range_or_list = first_partition.getMethod() == 'RANGE' or first_partition.getMethod() == 'RANGE COLUMNS' or first_partition.getMethod() == 'LIST' or first_partition.getMethod() == 'LIST COLUMNS' %} {% set sub_partitions = first_partition.getSubPartitions() %} {% set has_sub_partitions = first_partition.hasSubPartitions() %} {% if has_sub_partitions %} {% set first_sub_partition = sub_partitions[0] %} {% endif %} {% endif %} {# Displays Space usage and row statistics #} {% if show_stats %} {{ table_stats|raw }} {% endif %}
    {% endblock %}