1 <form action="{{ url('/table/indexes') }}"
7 {{ get_hidden_inputs(form_params) }}
9 <fieldset id="index_edit_fields">
10 <div class="index_info">
14 <label for="input_index_name">
15 {% trans 'Index name:' %}
16 {{ show_hint('"PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!'|trans) }}
22 name="index[Key_name]"
26 value="{{ index.getName() }}"
27 onfocus="this.select()">
33 <label for="select_index_choice">
34 {% trans 'Index choice:' %}
35 {{ show_mysql_docu('ALTER_TABLE') }}
40 <select name="index[Index_choice]" id="select_index_choice"{{ create_edit_table ? ' disabled' }}>
41 {% if index.getChoice() == 'PRIMARY' or not index.hasPrimary() %}
42 <option value="PRIMARY"{{ index.getChoice() == 'PRIMARY' ? ' selected' }}>PRIMARY</option>
44 <option value="INDEX"{{ index.getChoice() == 'INDEX' ? ' selected' }}>INDEX</option>
45 <option value="UNIQUE"{{ index.getChoice() == 'UNIQUE' ? ' selected' }}>UNIQUE</option>
46 <option value="SPATIAL"{{ index.getChoice() == 'SPATIAL' ? ' selected' }}>SPATIAL</option>
47 <option value="FULLTEXT"{{ index.getChoice() == 'FULLTEXT' ? ' selected' }}>FULLTEXT</option>
51 <div id="indexoptions"{% if default_sliders_state != 'disabled' -%}
52 {{- default_sliders_state == 'closed' ? ' style="display: none; overflow:auto;"' }} class="pma_auto_slider" title="{% trans 'Advanced options' %}"
58 <label for="input_key_block_size">
59 {% trans 'Key block size:' %}
65 name="index[Key_block_size]"
66 id="input_key_block_size"
68 value="{{ index.getKeyBlockSize() }}">
75 <label for="select_index_type">
76 {% trans 'Index type:' %}
77 {{ show_mysql_docu('ALTER_TABLE') }}
82 <select name="index[Index_type]" id="select_index_type">
83 {% for index_type in ['', 'BTREE', 'HASH'] %}
84 <option value="{{ index_type }}"{{ index.getType() == index_type ? ' selected' }}>{{ index_type }}</option>
92 <label for="input_parser">
102 value="{{ index.getParser() }}">
108 <label for="input_index_comment">
109 {% trans 'Comment:' %}
115 name="index[Index_comment]"
116 id="input_index_comment"
119 value="{{ index.getComment() }}">
122 <!-- end of indexoptions div -->
124 <div class="clearfloat"></div>
126 <table class="pma-table" id="index_columns">
138 {% set spatial_types = [
149 {% for column in index.getColumns() %}
152 <span class="drag_icon" title="{% trans 'Drag to reorder' %}"></span>
155 <select name="index[columns][names][]">
157 -- {% trans 'Ignore' %} --
159 {% for field_name, field_type in fields %}
160 {% if (index.getChoice() != 'FULLTEXT'
161 or field_type matches '/(char|text)/i')
162 and (index.getChoice() != 'SPATIAL'
163 or field_type in spatial_types) %}
165 <option value="{{ field_name }}"
166 {%- if field_name == column.getName() %}
169 {{ field_name }} [{{ field_type }}]
178 onfocus="this.select()"
179 name="index[columns][sub_parts][]"
180 value="{{ index.getChoice() != 'SPATIAL' ?
181 column.getSubPart() }}">
185 {% if add_fields > 0 %}
186 {% for i in range(1, add_fields) %}
189 <span class="drag_icon" title="{% trans 'Drag to reorder' %}"></span>
192 <select name="index[columns][names][]">
193 <option value="">-- {% trans 'Ignore' %} --</option>
195 {% for field_name, field_type in fields %}
196 {% if create_edit_table %}
197 {% set col_index = field_type[1] %}
198 {% set field_type = field_type[0] %}
201 <option value="{{ col_index is defined ?
202 col_index : field_name }}"
203 {{- j == i ? ' selected="selected"' }}>
204 {{ field_name }} [{{ field_type }}]
212 onfocus="this.select()"
213 name="index[columns][sub_parts][]"
221 <div class="add_more">
223 <div class="slider"></div>
224 <div class="add_fields hide">
225 <input class="btn btn-secondary" type="submit"
227 value="{{ 'Add %s column(s) to index'|trans|format(1) }}">
232 <fieldset class="tblFooters">
233 <button class="btn btn-secondary" type="submit" id="preview_index_frm">{% trans 'Preview SQL' %}</button>