{% trans 'Indexes' %} {{ show_mysql_docu('optimizing-database-structure') }} {% if indexes is not empty %} {{ indexes_duplicates|raw }} {{ include('modals/preview_sql_confirmation.twig') }}
{% 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' %}
{{ get_icon('b_edit', 'Edit'|trans) }} {{ get_icon('b_rename', 'Rename'|trans) }} {% if index.getName() == 'PRIMARY' %} {% set index_params = { 'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP PRIMARY KEY;', 'message_to_show': 'The primary key has been dropped.'|trans } %} {% else %} {% set index_params = { 'sql_query': 'ALTER TABLE ' ~ backquote(table) ~ ' DROP INDEX ' ~ backquote(index.getName()) ~ ';', 'message_to_show': 'Index %s has been dropped.'|trans|format(index.getName()) } %} {% endif %} {{ link_or_button( url('/sql'), url_params|merge(index_params), get_icon('b_drop', 'Drop'|trans), {'class': 'drop_primary_key_index_anchor ajax'} ) }} {{ index.getName() }} {{ index.getType()|default(index.getChoice()) }} {{ index.isUnique() ? 'Yes'|trans : 'No'|trans }} {{ index.isPacked()|raw }}
{% if column.hasExpression() %}{{ column.getExpression() }}{% else %}{{ column.getName() }}{% endif %} {% 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 %}