⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.103
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.22
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
phpmyadmin
/
templates
/
table
/
structure
/
View File Name :
display_structure.twig
{% extends 'table/page_with_secondary_tabs.twig' %} {% block content %}
{{table}}
{{ get_hidden_inputs(db, table) }}
{# Table header #}
#
{% trans 'Name' %}
{% trans 'Type' %}
{% trans 'Collation' %}
{% trans 'Attributes' %}
{% trans 'Null' %}
{% trans 'Default' %}
{% if show_column_comments -%}
{% trans 'Comments' %}
{%- endif %}
{% trans 'Extra' %}
{# @see table/structure.js, function moreOptsMenuResize() #} {% if not db_is_system_schema and not tbl_is_view %}
{% trans 'Action' %}
{% 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) #}
{{ rownum }}
{% if displayed_fields[rownum].comment is defined %}
{{ displayed_fields[rownum].text }}
{% else %} {{ displayed_fields[rownum].text }} {% endif %} {{ displayed_fields[rownum].icon|raw }}
{{ 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 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 %}
{% if show_column_comments %}
{{ comments }}
{% endif %}
{{ row['Extra']|upper }}
{% if not tbl_is_view and not db_is_system_schema %}
{{ get_icon('b_edit', 'Change'|trans) }}
{{ get_icon('b_drop', 'Drop'|trans) }}
{% 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'] %}
{% if hide_structure_actions %}
{{ get_icon('b_more', 'More'|trans) }}
{% endif %}
{% if type == 'text' or type == 'blob' or tbl_storage_engine == 'ARCHIVE' or (primary and primary.hasColumn(field_name)) %} {{ get_icon('bd_primary', 'Primary'|trans) }} {% else %}
{{ get_icon('b_primary', 'Primary'|trans) }}
{% endif %}
{% if type == 'text' or type == 'blob' or tbl_storage_engine == 'ARCHIVE' or field_name in columns_with_unique_index %} {{ get_icon('bd_unique', 'Unique'|trans) }} {% else %}
{{ get_icon('b_unique', 'Unique'|trans) }}
{% endif %}
{% if type == 'text' or type == 'blob' or tbl_storage_engine == 'ARCHIVE' %} {{ get_icon('bd_index', 'Index'|trans) }} {% else %}
{{ get_icon('b_index', 'Index'|trans) }}
{% endif %}
{% set spatial_types = [ 'geometry', 'point', 'linestring', 'polygon', 'multipoint', 'multilinestring', 'multipolygon', 'geomtrycollection' ] %}
{% if type == 'text' or type == 'blob' or tbl_storage_engine == 'ARCHIVE' or (type not in spatial_types and (tbl_storage_engine == 'MYISAM' or mysql_int_version >= 50705)) %} {{ get_icon('bd_spatial', 'Spatial'|trans) }} {% else %}
{{ get_icon('b_spatial', 'Spatial'|trans) }}
{% endif %}
{# FULLTEXT is possible on TEXT, CHAR and VARCHAR #}
{% if tbl_storage_engine is not empty and ( tbl_storage_engine == 'MYISAM' or tbl_storage_engine == 'ARIA' or tbl_storage_engine == 'MARIA' or (tbl_storage_engine == 'INNODB' and mysql_int_version >= 50604) ) and ('text' in type or 'char' in type) %}
{{ get_icon('b_ftext', 'Fulltext'|trans) }}
{% else %} {{ get_icon('bd_ftext', 'Fulltext'|trans) }} {% endif %}
{# Distinct value action #}
{{ get_icon('b_browse', 'Distinct values'|trans) }}
{% if central_columns_work %}
{% if row['Field'] in central_list %}
{{ get_icon('centralColumns_delete', 'Remove from central columns'|trans) }}
{% else %}
{{ get_icon('centralColumns_add', 'Add to central columns'|trans) }}
{% endif %}
{% endif %} {% if hide_structure_actions %}
{% endif %}
{% endif %}
{% endfor %}
{% include 'select_all.twig' with { 'theme_image_path': theme_image_path, 'text_dir': text_dir, 'form_name': 'fieldsForm' } only %}
{{ get_icon('b_browse', 'Browse'|trans) }}
{% if not tbl_is_view and not db_is_system_schema %}
{{ get_icon('b_edit', 'Change'|trans) }}
{{ get_icon('b_drop', 'Drop'|trans) }}
{% if tbl_storage_engine != 'ARCHIVE' %}
{{ get_icon('b_primary', 'Primary'|trans) }}
{{ get_icon('b_unique', 'Unique'|trans) }}
{{ get_icon('b_index', 'Index'|trans) }}
{{ get_icon('b_spatial', 'Spatial'|trans) }}
{{ get_icon('b_ftext', 'Fulltext'|trans) }}
{% if central_columns_work %}
{{ get_icon('centralColumns_add', 'Add to central columns'|trans) }}
{{ get_icon('centralColumns_delete', 'Remove from central columns'|trans) }}
{% endif %} {% endif %} {% endif %}
{% trans 'Move the columns by dragging them up and down.' %}
{{ get_hidden_inputs(db, table) }}
{# Work on the table #}
{% if tbl_is_view and not db_is_system_schema %} {{ link_or_button( url('/view/create', {'db': db, 'table': table}), get_icon('b_edit', 'Edit view'|trans, true) ) }} {% endif %}
{{ get_icon('b_print', 'Print'|trans, true) }}
{% if not tbl_is_view and not db_is_system_schema %} {# Only display propose table structure for MySQL < 8.0 #} {% if mysql_int_version < 80000 or is_mariadb %}
{{ get_icon( 'b_tblanalyse', 'Propose table structure'|trans, true ) }}
{{ show_mysql_docu('procedure_analyse') }} {% endif %} {% if is_active %}
{{ get_icon('eye', 'Track table'|trans, true) }}
{% endif %}
{{ get_icon('b_move', 'Move columns'|trans, true) }}
{{ get_icon('normalize', 'Normalize'|trans, true) }}
{% endif %} {% if tbl_is_view and not db_is_system_schema %} {% if is_active %}
{{ get_icon('eye', 'Track view'|trans, true) }}
{% endif %} {% endif %}
{% 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 #}
{% trans 'at beginning of table' %}
{% for one_column_name in columns_list %}
{{ 'after %s'|trans|format(one_column_name) }}
{% endfor %}
{% 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 }}
{% trans 'Action' %}
{% trans 'Keyname' %}
{% trans 'Type' %}
{% trans 'Unique' %}
{% trans 'Packed' %}
{% trans 'Column' %}
{% trans 'Cardinality' %}
{% trans 'Collation' %}
{% trans 'Null' %}
{% trans 'Comment' %}
{% for index in indexes %}
{% set columns_count = index.getColumnCount() %}
{{ 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', index_params|merge({'db': db, 'table': table})), 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 }}
{% for column in index.getColumns() %} {% if column.getSeqInIndex() > 1 %}
{% endif %}
{{ column.getName() }} {% if column.getSubPart() is not empty %} ({{ column.getSubPart() }}) {% endif %}
{{ column.getCardinality() }}
{{ column.getCollation() }}
{{ column.getNull(true) }}
{% if column.getSeqInIndex() == 1 %}
{{ index.getComments() }}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{{ 'No index defined!'|trans|notice }}
{% endif %}
{{ get_hidden_inputs(db, table) }}
{% apply format('
')|raw %} {% trans %}Create an index on %s columns{% endtrans %} {% endapply %}
{% 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 %}
{% include 'table/structure/display_partitions.twig' with { 'db': db, 'table': table, 'partitions': partitions, 'partition_method': first_partition.getMethod(), 'partition_expression': first_partition.getExpression(), 'has_description': first_partition.getDescription() is not empty, 'has_sub_partitions': has_sub_partitions, 'sub_partition_method': has_sub_partitions ? first_sub_partition.getMethod(), 'sub_partition_expression': has_sub_partitions ? first_sub_partition.getExpression(), 'range_or_list': range_or_list } only %} {% else %} {% include 'table/structure/display_partitions.twig' with { 'db': db, 'table': table } only %} {% endif %}
{% endif %} {# Displays Space usage and row statistics #} {% if show_stats %} {{ table_stats|raw }} {% endif %}
{% endblock %}