mirror of
https://github.com/vrana/adminer.git
synced 2025-08-22 22:23:19 +02:00
Require length when changing type from char to varchar
This commit is contained in:
@@ -355,12 +355,14 @@ function editingTypeChange(type) {
|
|||||||
var text = selectValue(type);
|
var text = selectValue(type);
|
||||||
for (var i=0; i < type.form.elements.length; i++) {
|
for (var i=0; i < type.form.elements.length; i++) {
|
||||||
var el = type.form.elements[i];
|
var el = type.form.elements[i];
|
||||||
if (el.name == name + '[length]' && !(
|
if (el.name == name + '[length]') {
|
||||||
(/(char|binary)$/.test(lastType) && /(char|binary)$/.test(text))
|
|
||||||
|| (/(enum|set)$/.test(lastType) && /(enum|set)$/.test(text))
|
|
||||||
)) {
|
|
||||||
el.required = /var(char|binary)$/.test(text);
|
el.required = /var(char|binary)$/.test(text);
|
||||||
el.value = '';
|
if (!(
|
||||||
|
(/(char|binary)$/.test(lastType) && /(char|binary)$/.test(text))
|
||||||
|
|| (/(enum|set)$/.test(lastType) && /(enum|set)$/.test(text))
|
||||||
|
)) {
|
||||||
|
el.value = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (lastType == 'timestamp' && el.name == name + '[has_default]' && /timestamp/i.test(formField(type.form, name + '[default]').value)) {
|
if (lastType == 'timestamp' && el.name == name + '[has_default]' && /timestamp/i.test(formField(type.form, name + '[default]').value)) {
|
||||||
el.checked = false;
|
el.checked = false;
|
||||||
|
Reference in New Issue
Block a user