
var rowCount = 0;

function addRow() {
    var modalDialog = document.getElementById("modelstyle");

    // Add styles dynamically using classList 
    modalDialog.classList.add("custom-style");

    // Or modify styles directly
    modalDialog.style.width = "101%";
    modalDialog.style.maxWidth = "90%";

    var columnCount = parseInt(document.getElementById('column_count').value);
    if (columnCount <= 0) return;

    var columnDetails = document.getElementById('column_details');

    document.getElementById('heder_col').style.display = 'block';

    for (var i = 0; i < columnCount; i++) {
        rowCount++;
        // Create a new row element
        var row = document.createElement('div');
        row.className = 'row';
        row.innerHTML = `
                <div class="row mb-3">
                    <div class="col-lg-1 col-md-4">
                        <input type="text" class="form-control" name="columns[${rowCount}][name]" placeholder="Column Name" required>
                    </div>
                    <div class="col-lg-1" >
                        <select class="form-select column-type" id="columns_${rowCount}_type" name="columns[${rowCount}][type]" onchange="toggletype(this, ${rowCount})"  required >
                            <option value="">Select Type</option>
                            <option value="integer">INT</option>
                            <option value="string">VARCHAR</option>
                            <option value="text">TEXT</option>
                            <option value="date">DATE</option>
                            <optgroup label="Numeric">
                                <option value="tinyInteger">TINYINT</option>
                                <option value="smallInteger">SMALLINT</option>
                                <option value="mediumInteger">MEDIUMINT</option>
                                <option value="integer">INT</option>
                                <option value="bigInteger">BIGINT</option>
                                <option value="decimal">DECIMAL</option>
                                <option value="float">FLOAT</option>
                                <option value="double">DOUBLE</option>
                                <option value="real">REAL</option>
                                <option value="boolean">BOOLEAN</option>
                                <option value="serial">SERIAL</option>
                            </optgroup>
                            <optgroup label="Date and time">
                                <option value="date">DATE</option>
                                <option value="dateTime">DATETIME</option>
                                <option value="timestamp">TIMESTAMP</option>
                                <option value="time">TIME</option>
                                <option value="year">YEAR</option>
                            </optgroup>
                            <optgroup label="String">
                                <option value="char">CHAR</option>
                                <option value="string">VARCHAR</option>
                                <option value="tinyText">TINYTEXT</option>
                                <option value="text">TEXT</option>
                                <option value="mediumText">MEDIUMTEXT</option>
                                <option value="longText">LONGTEXT</option>
                                <option value="binary">BINARY</option>
                                <option value="varBinary">VARBINARY</option>
                                <option value="tinyBlob">TINYBLOB</option>
                                <option value="blob">BLOB</option>
                                <option value="mediumBlob">MEDIUMBLOB</option>
                                <option value="longBlob">LONGBLOB</option>
                                <option value="enum">ENUM</option>
                                <option value="set">SET</option>
                            </optgroup>
                            <optgroup label="Spatial">
                                <option value="geometry">GEOMETRY</option>
                                <option value="point">POINT</option>
                                <option value="lineString">LINESTRING</option>
                                <option value="polygon">POLYGON</option>
                                <option value="multiPoint">MULTIPOINT</option>
                                <option value="multiLineString">MULTILINESTRING</option>
                                <option value="multiPolygon">MULTIPOLYGON</option>
                                <option value="geometryCollection">GEOMETRYCOLLECTION</option>
                            </optgroup>
                            <optgroup label="JSON">
                                <option value="json">JSON</option>
                            </optgroup>
                        </select>
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <input type="text" class="form-control column-length" id="columns_${rowCount}_length" name="columns[${rowCount}][length]" placeholder="Length/Values" >
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select name="columns[${rowCount}][default]" id="columns_${rowCount}_default" class="default_type form-select" onchange="toggleInput(this, ${rowCount})">
                            <option value="">None</option>
                            <option value="USER_DEFINED">As defined:</option>
                            <option value="NULL">NULL</option>
                            <option value="CURRENT_TIMESTAMP">CURRENT_TIMESTAMP</option>
                        </select>
                        <input type="text" name="columns[${rowCount}][default_value]" id="columns_${rowCount}_default_value" size="12" value="" class="form-control textfield default_value" style="display: none;">
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select name="columns[${rowCount}][field_collation]"  id="columns_${rowCount}_field_collation" class=" form-select">
                            <option value=""></option>
                            <optgroup label="armscii8" title="ARMSCII-8 Armenian">
                                <option value="armscii8_bin" title="Armenian, binary">armscii8_bin</option>
                                <option value="armscii8_general_ci" title="Armenian, case-insensitive">armscii8_general_ci</option>
                                <option value="armscii8_general_nopad_ci" title="Armenian, no-pad, case-insensitive">armscii8_general_nopad_ci
                                </option>
                                <option value="armscii8_nopad_bin" title="Armenian, no-pad, binary">armscii8_nopad_bin</option>
                            </optgroup>
                            <optgroup label="ascii" title="US ASCII">
                                <option value="ascii_bin" title="West European, binary">ascii_bin</option>
                                <option value="ascii_general_ci" title="West European, case-insensitive">ascii_general_ci</option>
                                <option value="ascii_general_nopad_ci" title="West European, no-pad, case-insensitive">ascii_general_nopad_ci
                                </option>
                                <option value="ascii_nopad_bin" title="West European, no-pad, binary">ascii_nopad_bin</option>
                            </optgroup>
                            <optgroup label="big5" title="Big5 Traditional Chinese">
                                <option value="big5_bin" title="Traditional Chinese, binary">big5_bin</option>
                                <option value="big5_chinese_ci" title="Traditional Chinese, case-insensitive">big5_chinese_ci</option>
                                <option value="big5_chinese_nopad_ci" title="Traditional Chinese, no-pad, case-insensitive">big5_chinese_nopad_ci
                                </option>
                                <option value="big5_nopad_bin" title="Traditional Chinese, no-pad, binary">big5_nopad_bin</option>
                            </optgroup>
                            <optgroup label="binary" title="Binary pseudo charset">
                                <option value="binary" title="Binary">binary</option>
                            </optgroup>
                            <optgroup label="cp1250" title="Windows Central European">
                                <option value="cp1250_bin" title="Central European, binary">cp1250_bin</option>
                                <option value="cp1250_croatian_ci" title="Croatian, case-insensitive">cp1250_croatian_ci</option>
                                <option value="cp1250_czech_cs" title="Czech, case-sensitive">cp1250_czech_cs</option>
                                <option value="cp1250_general_ci" title="Central European, case-insensitive">cp1250_general_ci</option>
                                <option value="cp1250_general_nopad_ci" title="Central European, no-pad, case-insensitive">cp1250_general_nopad_ci
                                </option>
                                <option value="cp1250_nopad_bin" title="Central European, no-pad, binary">cp1250_nopad_bin</option>
                                <option value="cp1250_polish_ci" title="Polish, case-insensitive">cp1250_polish_ci</option>
                            </optgroup>
                            <optgroup label="cp1251" title="Windows Cyrillic">
                                <option value="cp1251_bin" title="Cyrillic, binary">cp1251_bin</option>
                                <option value="cp1251_bulgarian_ci" title="Bulgarian, case-insensitive">cp1251_bulgarian_ci</option>
                                <option value="cp1251_general_ci" title="Cyrillic, case-insensitive">cp1251_general_ci</option>
                                <option value="cp1251_general_cs" title="Cyrillic, case-sensitive">cp1251_general_cs</option>
                                <option value="cp1251_general_nopad_ci" title="Cyrillic, no-pad, case-insensitive">cp1251_general_nopad_ci</option>
                                <option value="cp1251_nopad_bin" title="Cyrillic, no-pad, binary">cp1251_nopad_bin</option>
                                <option value="cp1251_ukrainian_ci" title="Ukrainian, case-insensitive">cp1251_ukrainian_ci</option>
                            </optgroup>
                            <optgroup label="cp1256" title="Windows Arabic">
                                <option value="cp1256_bin" title="Arabic, binary">cp1256_bin</option>
                                <option value="cp1256_general_ci" title="Arabic, case-insensitive">cp1256_general_ci</option>
                                <option value="cp1256_general_nopad_ci" title="Arabic, no-pad, case-insensitive">cp1256_general_nopad_ci</option>
                                <option value="cp1256_nopad_bin" title="Arabic, no-pad, binary">cp1256_nopad_bin</option>
                            </optgroup>
                            <optgroup label="cp1257" title="Windows Baltic">
                                <option value="cp1257_bin" title="Baltic, binary">cp1257_bin</option>
                                <option value="cp1257_general_ci" title="Baltic, case-insensitive">cp1257_general_ci</option>
                                <option value="cp1257_general_nopad_ci" title="Baltic, no-pad, case-insensitive">cp1257_general_nopad_ci</option>
                                <option value="cp1257_lithuanian_ci" title="Lithuanian, case-insensitive">cp1257_lithuanian_ci</option>
                                <option value="cp1257_nopad_bin" title="Baltic, no-pad, binary">cp1257_nopad_bin</option>
                            </optgroup>
                            <optgroup label="cp850" title="DOS West European">
                                <option value="cp850_bin" title="West European, binary">cp850_bin</option>
                                <option value="cp850_general_ci" title="West European, case-insensitive">cp850_general_ci</option>
                                <option value="cp850_general_nopad_ci" title="West European, no-pad, case-insensitive">cp850_general_nopad_ci
                                </option>
                                <option value="cp850_nopad_bin" title="West European, no-pad, binary">cp850_nopad_bin</option>
                            </optgroup>
                            <optgroup label="cp852" title="DOS Central European">
                                <option value="cp852_bin" title="Central European, binary">cp852_bin</option>
                                <option value="cp852_general_ci" title="Central European, case-insensitive">cp852_general_ci</option>
                                <option value="cp852_general_nopad_ci" title="Central European, no-pad, case-insensitive">cp852_general_nopad_ci
                                </option>
                                <option value="cp852_nopad_bin" title="Central European, no-pad, binary">cp852_nopad_bin</option>
                            </optgroup>
                            <optgroup label="cp866" title="DOS Russian">
                                <option value="cp866_bin" title="Russian, binary">cp866_bin</option>
                                <option value="cp866_general_ci" title="Russian, case-insensitive">cp866_general_ci</option>
                                <option value="cp866_general_nopad_ci" title="Russian, no-pad, case-insensitive">cp866_general_nopad_ci</option>
                                <option value="cp866_nopad_bin" title="Russian, no-pad, binary">cp866_nopad_bin</option>
                            </optgroup>
                            <optgroup label="cp932" title="SJIS for Windows Japanese">
                                <option value="cp932_bin" title="Japanese, binary">cp932_bin</option>
                                <option value="cp932_japanese_ci" title="Japanese, case-insensitive">cp932_japanese_ci</option>
                                <option value="cp932_japanese_nopad_ci" title="Japanese, no-pad, case-insensitive">cp932_japanese_nopad_ci</option>
                                <option value="cp932_nopad_bin" title="Japanese, no-pad, binary">cp932_nopad_bin</option>
                            </optgroup>
                            <optgroup label="dec8" title="DEC West European">
                                <option value="dec8_bin" title="West European, binary">dec8_bin</option>
                                <option value="dec8_nopad_bin" title="West European, no-pad, binary">dec8_nopad_bin</option>
                                <option value="dec8_swedish_ci" title="Swedish, case-insensitive">dec8_swedish_ci</option>
                                <option value="dec8_swedish_nopad_ci" title="Swedish, no-pad, case-insensitive">dec8_swedish_nopad_ci</option>
                            </optgroup>
                            <optgroup label="eucjpms" title="UJIS for Windows Japanese">
                                <option value="eucjpms_bin" title="Japanese, binary">eucjpms_bin</option>
                                <option value="eucjpms_japanese_ci" title="Japanese, case-insensitive">eucjpms_japanese_ci</option>
                                <option value="eucjpms_japanese_nopad_ci" title="Japanese, no-pad, case-insensitive">eucjpms_japanese_nopad_ci
                                </option>
                                <option value="eucjpms_nopad_bin" title="Japanese, no-pad, binary">eucjpms_nopad_bin</option>
                            </optgroup>
                            <optgroup label="euckr" title="EUC-KR Korean">
                                <option value="euckr_bin" title="Korean, binary">euckr_bin</option>
                                <option value="euckr_korean_ci" title="Korean, case-insensitive">euckr_korean_ci</option>
                                <option value="euckr_korean_nopad_ci" title="Korean, no-pad, case-insensitive">euckr_korean_nopad_ci</option>
                                <option value="euckr_nopad_bin" title="Korean, no-pad, binary">euckr_nopad_bin</option>
                            </optgroup>
                            <optgroup label="gb2312" title="GB2312 Simplified Chinese">
                                <option value="gb2312_bin" title="Simplified Chinese, binary">gb2312_bin</option>
                                <option value="gb2312_chinese_ci" title="Simplified Chinese, case-insensitive">gb2312_chinese_ci</option>
                                <option value="gb2312_chinese_nopad_ci" title="Simplified Chinese, no-pad, case-insensitive">gb2312_chinese_nopad_ci
                                </option>
                                <option value="gb2312_nopad_bin" title="Simplified Chinese, no-pad, binary">gb2312_nopad_bin</option>
                            </optgroup>
                            <optgroup label="gbk" title="GBK Simplified Chinese">
                                <option value="gbk_bin" title="Simplified Chinese, binary">gbk_bin</option>
                                <option value="gbk_chinese_ci" title="Simplified Chinese, case-insensitive">gbk_chinese_ci</option>
                                <option value="gbk_chinese_nopad_ci" title="Simplified Chinese, no-pad, case-insensitive">gbk_chinese_nopad_ci
                                </option>
                                <option value="gbk_nopad_bin" title="Simplified Chinese, no-pad, binary">gbk_nopad_bin</option>
                            </optgroup>
                            <optgroup label="geostd8" title="GEOSTD8 Georgian">
                                <option value="geostd8_bin" title="Georgian, binary">geostd8_bin</option>
                                <option value="geostd8_general_ci" title="Georgian, case-insensitive">geostd8_general_ci</option>
                                <option value="geostd8_general_nopad_ci" title="Georgian, no-pad, case-insensitive">geostd8_general_nopad_ci
                                </option>
                                <option value="geostd8_nopad_bin" title="Georgian, no-pad, binary">geostd8_nopad_bin</option>
                            </optgroup>
                            <optgroup label="greek" title="ISO 8859-7 Greek">
                                <option value="greek_bin" title="Greek, binary">greek_bin</option>
                                <option value="greek_general_ci" title="Greek, case-insensitive">greek_general_ci</option>
                                <option value="greek_general_nopad_ci" title="Greek, no-pad, case-insensitive">greek_general_nopad_ci</option>
                                <option value="greek_nopad_bin" title="Greek, no-pad, binary">greek_nopad_bin</option>
                            </optgroup>
                            <optgroup label="hebrew" title="ISO 8859-8 Hebrew">
                                <option value="hebrew_bin" title="Hebrew, binary">hebrew_bin</option>
                                <option value="hebrew_general_ci" title="Hebrew, case-insensitive">hebrew_general_ci</option>
                                <option value="hebrew_general_nopad_ci" title="Hebrew, no-pad, case-insensitive">hebrew_general_nopad_ci</option>
                                <option value="hebrew_nopad_bin" title="Hebrew, no-pad, binary">hebrew_nopad_bin</option>
                            </optgroup>
                            <optgroup label="hp8" title="HP West European">
                                <option value="hp8_bin" title="West European, binary">hp8_bin</option>
                                <option value="hp8_english_ci" title="English, case-insensitive">hp8_english_ci</option>
                                <option value="hp8_english_nopad_ci" title="English, no-pad, case-insensitive">hp8_english_nopad_ci</option>
                                <option value="hp8_nopad_bin" title="West European, no-pad, binary">hp8_nopad_bin</option>
                            </optgroup>
                            <optgroup label="keybcs2" title="DOS Kamenicky Czech-Slovak">
                                <option value="keybcs2_bin" title="Czech-Slovak, binary">keybcs2_bin</option>
                                <option value="keybcs2_general_ci" title="Czech-Slovak, case-insensitive">keybcs2_general_ci</option>
                                <option value="keybcs2_general_nopad_ci" title="Czech-Slovak, no-pad, case-insensitive">keybcs2_general_nopad_ci
                                </option>
                                <option value="keybcs2_nopad_bin" title="Czech-Slovak, no-pad, binary">keybcs2_nopad_bin</option>
                            </optgroup>
                            <optgroup label="koi8r" title="KOI8-R Relcom Russian">
                                <option value="koi8r_bin" title="Russian, binary">koi8r_bin</option>
                                <option value="koi8r_general_ci" title="Russian, case-insensitive">koi8r_general_ci</option>
                                <option value="koi8r_general_nopad_ci" title="Russian, no-pad, case-insensitive">koi8r_general_nopad_ci</option>
                                <option value="koi8r_nopad_bin" title="Russian, no-pad, binary">koi8r_nopad_bin</option>
                            </optgroup>
                            <optgroup label="koi8u" title="KOI8-U Ukrainian">
                                <option value="koi8u_bin" title="Ukrainian, binary">koi8u_bin</option>
                                <option value="koi8u_general_ci" title="Ukrainian, case-insensitive">koi8u_general_ci</option>
                                <option value="koi8u_general_nopad_ci" title="Ukrainian, no-pad, case-insensitive">koi8u_general_nopad_ci</option>
                                <option value="koi8u_nopad_bin" title="Ukrainian, no-pad, binary">koi8u_nopad_bin</option>
                            </optgroup>
                            <optgroup label="latin1" title="cp1252 West European">
                                <option value="latin1_bin" title="West European, binary">latin1_bin</option>
                                <option value="latin1_danish_ci" title="Danish, case-insensitive">latin1_danish_ci</option>
                                <option value="latin1_general_ci" title="West European, case-insensitive">latin1_general_ci</option>
                                <option value="latin1_general_cs" title="West European, case-sensitive">latin1_general_cs</option>
                                <option value="latin1_german1_ci" title="German (dictionary order), case-insensitive">latin1_german1_ci</option>
                                <option value="latin1_german2_ci" title="German (phone book order), case-insensitive">latin1_german2_ci</option>
                                <option value="latin1_nopad_bin" title="West European, no-pad, binary">latin1_nopad_bin</option>
                                <option value="latin1_spanish_ci" title="Spanish (modern), case-insensitive">latin1_spanish_ci</option>
                                <option value="latin1_swedish_ci" title="Swedish, case-insensitive">latin1_swedish_ci</option>
                                <option value="latin1_swedish_nopad_ci" title="Swedish, no-pad, case-insensitive">latin1_swedish_nopad_ci</option>
                            </optgroup>
                            <optgroup label="latin2" title="ISO 8859-2 Central European">
                                <option value="latin2_bin" title="Central European, binary">latin2_bin</option>
                                <option value="latin2_croatian_ci" title="Croatian, case-insensitive">latin2_croatian_ci</option>
                                <option value="latin2_czech_cs" title="Czech, case-sensitive">latin2_czech_cs</option>
                                <option value="latin2_general_ci" title="Central European, case-insensitive">latin2_general_ci</option>
                                <option value="latin2_general_nopad_ci" title="Central European, no-pad, case-insensitive">latin2_general_nopad_ci
                                </option>
                                <option value="latin2_hungarian_ci" title="Hungarian, case-insensitive">latin2_hungarian_ci</option>
                                <option value="latin2_nopad_bin" title="Central European, no-pad, binary">latin2_nopad_bin</option>
                            </optgroup>
                            <optgroup label="latin5" title="ISO 8859-9 Turkish">
                                <option value="latin5_bin" title="Turkish, binary">latin5_bin</option>
                                <option value="latin5_nopad_bin" title="Turkish, no-pad, binary">latin5_nopad_bin</option>
                                <option value="latin5_turkish_ci" title="Turkish, case-insensitive">latin5_turkish_ci</option>
                                <option value="latin5_turkish_nopad_ci" title="Turkish, no-pad, case-insensitive">latin5_turkish_nopad_ci</option>
                            </optgroup>
                            <optgroup label="latin7" title="ISO 8859-13 Baltic">
                                <option value="latin7_bin" title="Baltic, binary">latin7_bin</option>
                                <option value="latin7_estonian_cs" title="Estonian, case-sensitive">latin7_estonian_cs</option>
                                <option value="latin7_general_ci" title="Baltic, case-insensitive">latin7_general_ci</option>
                                <option value="latin7_general_cs" title="Baltic, case-sensitive">latin7_general_cs</option>
                                <option value="latin7_general_nopad_ci" title="Baltic, no-pad, case-insensitive">latin7_general_nopad_ci</option>
                                <option value="latin7_nopad_bin" title="Baltic, no-pad, binary">latin7_nopad_bin</option>
                            </optgroup>
                            <optgroup label="macce" title="Mac Central European">
                                <option value="macce_bin" title="Central European, binary">macce_bin</option>
                                <option value="macce_general_ci" title="Central European, case-insensitive">macce_general_ci</option>
                                <option value="macce_general_nopad_ci" title="Central European, no-pad, case-insensitive">macce_general_nopad_ci
                                </option>
                                <option value="macce_nopad_bin" title="Central European, no-pad, binary">macce_nopad_bin</option>
                            </optgroup>
                            <optgroup label="macroman" title="Mac West European">
                                <option value="macroman_bin" title="West European, binary">macroman_bin</option>
                                <option value="macroman_general_ci" title="West European, case-insensitive">macroman_general_ci</option>
                                <option value="macroman_general_nopad_ci" title="West European, no-pad, case-insensitive">macroman_general_nopad_ci
                                </option>
                                <option value="macroman_nopad_bin" title="West European, no-pad, binary">macroman_nopad_bin</option>
                            </optgroup>
                            <optgroup label="sjis" title="Shift-JIS Japanese">
                                <option value="sjis_bin" title="Japanese, binary">sjis_bin</option>
                                <option value="sjis_japanese_ci" title="Japanese, case-insensitive">sjis_japanese_ci</option>
                                <option value="sjis_japanese_nopad_ci" title="Japanese, no-pad, case-insensitive">sjis_japanese_nopad_ci</option>
                                <option value="sjis_nopad_bin" title="Japanese, no-pad, binary">sjis_nopad_bin</option>
                            </optgroup>
                            <optgroup label="swe7" title="7bit Swedish">
                                <option value="swe7_bin" title="Swedish, binary">swe7_bin</option>
                                <option value="swe7_nopad_bin" title="Swedish, no-pad, binary">swe7_nopad_bin</option>
                                <option value="swe7_swedish_ci" title="Swedish, case-insensitive">swe7_swedish_ci</option>
                                <option value="swe7_swedish_nopad_ci" title="Swedish, no-pad, case-insensitive">swe7_swedish_nopad_ci</option>
                            </optgroup>
                            <optgroup label="tis620" title="TIS620 Thai">
                                <option value="tis620_bin" title="Thai, binary">tis620_bin</option>
                                <option value="tis620_nopad_bin" title="Thai, no-pad, binary">tis620_nopad_bin</option>
                                <option value="tis620_thai_ci" title="Thai, case-insensitive">tis620_thai_ci</option>
                                <option value="tis620_thai_nopad_ci" title="Thai, no-pad, case-insensitive">tis620_thai_nopad_ci</option>
                            </optgroup>
                            <optgroup label="ucs2" title="UCS-2 Unicode">
                                <option value="ucs2_bin" title="Unicode, binary">ucs2_bin</option>
                                <option value="ucs2_croatian_ci" title="Croatian, case-insensitive">ucs2_croatian_ci</option>
                                <option value="ucs2_croatian_mysql561_ci" title="Croatian (MySQL 5.6.1), case-insensitive">ucs2_croatian_mysql561_ci
                                </option>
                                <option value="ucs2_czech_ci" title="Czech, case-insensitive">ucs2_czech_ci</option>
                                <option value="ucs2_danish_ci" title="Danish, case-insensitive">ucs2_danish_ci</option>
                                <option value="ucs2_esperanto_ci" title="Esperanto, case-insensitive">ucs2_esperanto_ci</option>
                                <option value="ucs2_estonian_ci" title="Estonian, case-insensitive">ucs2_estonian_ci</option>
                                <option value="ucs2_general_ci" title="Unicode, case-insensitive">ucs2_general_ci</option>
                                <option value="ucs2_general_mysql500_ci" title="Unicode (MySQL 5.0.0), case-insensitive">ucs2_general_mysql500_ci
                                </option>
                                <option value="ucs2_general_nopad_ci" title="Unicode, no-pad, case-insensitive">ucs2_general_nopad_ci</option>
                                <option value="ucs2_german2_ci" title="German (phone book order), case-insensitive">ucs2_german2_ci</option>
                                <option value="ucs2_hungarian_ci" title="Hungarian, case-insensitive">ucs2_hungarian_ci</option>
                                <option value="ucs2_icelandic_ci" title="Icelandic, case-insensitive">ucs2_icelandic_ci</option>
                                <option value="ucs2_latvian_ci" title="Latvian, case-insensitive">ucs2_latvian_ci</option>
                                <option value="ucs2_lithuanian_ci" title="Lithuanian, case-insensitive">ucs2_lithuanian_ci</option>
                                <option value="ucs2_myanmar_ci" title="Burmese, case-insensitive">ucs2_myanmar_ci</option>
                                <option value="ucs2_nopad_bin" title="Unicode, no-pad, binary">ucs2_nopad_bin</option>
                                <option value="ucs2_persian_ci" title="Persian, case-insensitive">ucs2_persian_ci</option>
                                <option value="ucs2_polish_ci" title="Polish, case-insensitive">ucs2_polish_ci</option>
                                <option value="ucs2_roman_ci" title="West European, case-insensitive">ucs2_roman_ci</option>
                                <option value="ucs2_romanian_ci" title="Romanian, case-insensitive">ucs2_romanian_ci</option>
                                <option value="ucs2_sinhala_ci" title="Sinhalese, case-insensitive">ucs2_sinhala_ci</option>
                                <option value="ucs2_slovak_ci" title="Slovak, case-insensitive">ucs2_slovak_ci</option>
                                <option value="ucs2_slovenian_ci" title="Slovenian, case-insensitive">ucs2_slovenian_ci</option>
                                <option value="ucs2_spanish2_ci" title="Spanish (traditional), case-insensitive">ucs2_spanish2_ci</option>
                                <option value="ucs2_spanish_ci" title="Spanish (modern), case-insensitive">ucs2_spanish_ci</option>
                                <option value="ucs2_swedish_ci" title="Swedish, case-insensitive">ucs2_swedish_ci</option>
                                <option value="ucs2_thai_520_w2" title="Thai (UCA 5.2.0), multi-level">ucs2_thai_520_w2</option>
                                <option value="ucs2_turkish_ci" title="Turkish, case-insensitive">ucs2_turkish_ci</option>
                                <option value="ucs2_unicode_520_ci" title="Unicode (UCA 5.2.0), case-insensitive">ucs2_unicode_520_ci</option>
                                <option value="ucs2_unicode_520_nopad_ci" title="Unicode (UCA 5.2.0), no-pad, case-insensitive">
                                    ucs2_unicode_520_nopad_ci</option>
                                <option value="ucs2_unicode_ci" title="Unicode, case-insensitive">ucs2_unicode_ci</option>
                                <option value="ucs2_unicode_nopad_ci" title="Unicode, no-pad, case-insensitive">ucs2_unicode_nopad_ci</option>
                                <option value="ucs2_vietnamese_ci" title="Vietnamese, case-insensitive">ucs2_vietnamese_ci</option>
                            </optgroup>
                            <optgroup label="ujis" title="EUC-JP Japanese">
                                <option value="ujis_bin" title="Japanese, binary">ujis_bin</option>
                                <option value="ujis_japanese_ci" title="Japanese, case-insensitive">ujis_japanese_ci</option>
                                <option value="ujis_japanese_nopad_ci" title="Japanese, no-pad, case-insensitive">ujis_japanese_nopad_ci</option>
                                <option value="ujis_nopad_bin" title="Japanese, no-pad, binary">ujis_nopad_bin</option>
                            </optgroup>
                            <optgroup label="utf16" title="UTF-16 Unicode">
                                <option value="utf16_bin" title="Unicode, binary">utf16_bin</option>
                                <option value="utf16_croatian_ci" title="Croatian, case-insensitive">utf16_croatian_ci</option>
                                <option value="utf16_croatian_mysql561_ci" title="Croatian (MySQL 5.6.1), case-insensitive">
                                    utf16_croatian_mysql561_ci</option>
                                <option value="utf16_czech_ci" title="Czech, case-insensitive">utf16_czech_ci</option>
                                <option value="utf16_danish_ci" title="Danish, case-insensitive">utf16_danish_ci</option>
                                <option value="utf16_esperanto_ci" title="Esperanto, case-insensitive">utf16_esperanto_ci</option>
                                <option value="utf16_estonian_ci" title="Estonian, case-insensitive">utf16_estonian_ci</option>
                                <option value="utf16_general_ci" title="Unicode, case-insensitive">utf16_general_ci</option>
                                <option value="utf16_general_nopad_ci" title="Unicode, no-pad, case-insensitive">utf16_general_nopad_ci</option>
                                <option value="utf16_german2_ci" title="German (phone book order), case-insensitive">utf16_german2_ci</option>
                                <option value="utf16_hungarian_ci" title="Hungarian, case-insensitive">utf16_hungarian_ci</option>
                                <option value="utf16_icelandic_ci" title="Icelandic, case-insensitive">utf16_icelandic_ci</option>
                                <option value="utf16_latvian_ci" title="Latvian, case-insensitive">utf16_latvian_ci</option>
                                <option value="utf16_lithuanian_ci" title="Lithuanian, case-insensitive">utf16_lithuanian_ci</option>
                                <option value="utf16_myanmar_ci" title="Burmese, case-insensitive">utf16_myanmar_ci</option>
                                <option value="utf16_nopad_bin" title="Unicode, no-pad, binary">utf16_nopad_bin</option>
                                <option value="utf16_persian_ci" title="Persian, case-insensitive">utf16_persian_ci</option>
                                <option value="utf16_polish_ci" title="Polish, case-insensitive">utf16_polish_ci</option>
                                <option value="utf16_roman_ci" title="West European, case-insensitive">utf16_roman_ci</option>
                                <option value="utf16_romanian_ci" title="Romanian, case-insensitive">utf16_romanian_ci</option>
                                <option value="utf16_sinhala_ci" title="Sinhalese, case-insensitive">utf16_sinhala_ci</option>
                                <option value="utf16_slovak_ci" title="Slovak, case-insensitive">utf16_slovak_ci</option>
                                <option value="utf16_slovenian_ci" title="Slovenian, case-insensitive">utf16_slovenian_ci</option>
                                <option value="utf16_spanish2_ci" title="Spanish (traditional), case-insensitive">utf16_spanish2_ci</option>
                                <option value="utf16_spanish_ci" title="Spanish (modern), case-insensitive">utf16_spanish_ci</option>
                                <option value="utf16_swedish_ci" title="Swedish, case-insensitive">utf16_swedish_ci</option>
                                <option value="utf16_thai_520_w2" title="Thai (UCA 5.2.0), multi-level">utf16_thai_520_w2</option>
                                <option value="utf16_turkish_ci" title="Turkish, case-insensitive">utf16_turkish_ci</option>
                                <option value="utf16_unicode_520_ci" title="Unicode (UCA 5.2.0), case-insensitive">utf16_unicode_520_ci</option>
                                <option value="utf16_unicode_520_nopad_ci" title="Unicode (UCA 5.2.0), no-pad, case-insensitive">
                                    utf16_unicode_520_nopad_ci</option>
                                <option value="utf16_unicode_ci" title="Unicode, case-insensitive">utf16_unicode_ci</option>
                                <option value="utf16_unicode_nopad_ci" title="Unicode, no-pad, case-insensitive">utf16_unicode_nopad_ci</option>
                                <option value="utf16_vietnamese_ci" title="Vietnamese, case-insensitive">utf16_vietnamese_ci</option>
                            </optgroup>
                            <optgroup label="utf16le" title="UTF-16LE Unicode">
                                <option value="utf16le_bin" title="Unicode, binary">utf16le_bin</option>
                                <option value="utf16le_general_ci" title="Unicode, case-insensitive">utf16le_general_ci</option>
                                <option value="utf16le_general_nopad_ci" title="Unicode, no-pad, case-insensitive">utf16le_general_nopad_ci</option>
                                <option value="utf16le_nopad_bin" title="Unicode, no-pad, binary">utf16le_nopad_bin</option>
                            </optgroup>
                            <optgroup label="utf32" title="UTF-32 Unicode">
                                <option value="utf32_bin" title="Unicode, binary">utf32_bin</option>
                                <option value="utf32_croatian_ci" title="Croatian, case-insensitive">utf32_croatian_ci</option>
                                <option value="utf32_croatian_mysql561_ci" title="Croatian (MySQL 5.6.1), case-insensitive">
                                    utf32_croatian_mysql561_ci</option>
                                <option value="utf32_czech_ci" title="Czech, case-insensitive">utf32_czech_ci</option>
                                <option value="utf32_danish_ci" title="Danish, case-insensitive">utf32_danish_ci</option>
                                <option value="utf32_esperanto_ci" title="Esperanto, case-insensitive">utf32_esperanto_ci</option>
                                <option value="utf32_estonian_ci" title="Estonian, case-insensitive">utf32_estonian_ci</option>
                                <option value="utf32_general_ci" title="Unicode, case-insensitive">utf32_general_ci</option>
                                <option value="utf32_general_nopad_ci" title="Unicode, no-pad, case-insensitive">utf32_general_nopad_ci</option>
                                <option value="utf32_german2_ci" title="German (phone book order), case-insensitive">utf32_german2_ci</option>
                                <option value="utf32_hungarian_ci" title="Hungarian, case-insensitive">utf32_hungarian_ci</option>
                                <option value="utf32_icelandic_ci" title="Icelandic, case-insensitive">utf32_icelandic_ci</option>
                                <option value="utf32_latvian_ci" title="Latvian, case-insensitive">utf32_latvian_ci</option>
                                <option value="utf32_lithuanian_ci" title="Lithuanian, case-insensitive">utf32_lithuanian_ci</option>
                                <option value="utf32_myanmar_ci" title="Burmese, case-insensitive">utf32_myanmar_ci</option>
                                <option value="utf32_nopad_bin" title="Unicode, no-pad, binary">utf32_nopad_bin</option>
                                <option value="utf32_persian_ci" title="Persian, case-insensitive">utf32_persian_ci</option>
                                <option value="utf32_polish_ci" title="Polish, case-insensitive">utf32_polish_ci</option>
                                <option value="utf32_roman_ci" title="West European, case-insensitive">utf32_roman_ci</option>
                                <option value="utf32_romanian_ci" title="Romanian, case-insensitive">utf32_romanian_ci</option>
                                <option value="utf32_sinhala_ci" title="Sinhalese, case-insensitive">utf32_sinhala_ci</option>
                                <option value="utf32_slovak_ci" title="Slovak, case-insensitive">utf32_slovak_ci</option>
                                <option value="utf32_slovenian_ci" title="Slovenian, case-insensitive">utf32_slovenian_ci</option>
                                <option value="utf32_spanish2_ci" title="Spanish (traditional), case-insensitive">utf32_spanish2_ci</option>
                                <option value="utf32_spanish_ci" title="Spanish (modern), case-insensitive">utf32_spanish_ci</option>
                                <option value="utf32_swedish_ci" title="Swedish, case-insensitive">utf32_swedish_ci</option>
                                <option value="utf32_thai_520_w2" title="Thai (UCA 5.2.0), multi-level">utf32_thai_520_w2</option>
                                <option value="utf32_turkish_ci" title="Turkish, case-insensitive">utf32_turkish_ci</option>
                                <option value="utf32_unicode_520_ci" title="Unicode (UCA 5.2.0), case-insensitive">utf32_unicode_520_ci</option>
                                <option value="utf32_unicode_520_nopad_ci" title="Unicode (UCA 5.2.0), no-pad, case-insensitive">
                                    utf32_unicode_520_nopad_ci</option>
                                <option value="utf32_unicode_ci" title="Unicode, case-insensitive">utf32_unicode_ci</option>
                                <option value="utf32_unicode_nopad_ci" title="Unicode, no-pad, case-insensitive">utf32_unicode_nopad_ci</option>
                                <option value="utf32_vietnamese_ci" title="Vietnamese, case-insensitive">utf32_vietnamese_ci</option>
                            </optgroup>
                            <optgroup label="utf8" title="UTF-8 Unicode">
                                <option value="utf8_bin" title="Unicode, binary">utf8_bin</option>
                                <option value="utf8_croatian_ci" title="Croatian, case-insensitive">utf8_croatian_ci</option>
                                <option value="utf8_croatian_mysql561_ci" title="Croatian (MySQL 5.6.1), case-insensitive">utf8_croatian_mysql561_ci
                                </option>
                                <option value="utf8_czech_ci" title="Czech, case-insensitive">utf8_czech_ci</option>
                                <option value="utf8_danish_ci" title="Danish, case-insensitive">utf8_danish_ci</option>
                                <option value="utf8_esperanto_ci" title="Esperanto, case-insensitive">utf8_esperanto_ci</option>
                                <option value="utf8_estonian_ci" title="Estonian, case-insensitive">utf8_estonian_ci</option>
                                <option value="utf8_general_ci" title="Unicode, case-insensitive">utf8_general_ci</option>
                                <option value="utf8_general_mysql500_ci" title="Unicode (MySQL 5.0.0), case-insensitive">utf8_general_mysql500_ci
                                </option>
                                <option value="utf8_general_nopad_ci" title="Unicode, no-pad, case-insensitive">utf8_general_nopad_ci</option>
                                <option value="utf8_german2_ci" title="German (phone book order), case-insensitive">utf8_german2_ci</option>
                                <option value="utf8_hungarian_ci" title="Hungarian, case-insensitive">utf8_hungarian_ci</option>
                                <option value="utf8_icelandic_ci" title="Icelandic, case-insensitive">utf8_icelandic_ci</option>
                                <option value="utf8_latvian_ci" title="Latvian, case-insensitive">utf8_latvian_ci</option>
                                <option value="utf8_lithuanian_ci" title="Lithuanian, case-insensitive">utf8_lithuanian_ci</option>
                                <option value="utf8_myanmar_ci" title="Burmese, case-insensitive">utf8_myanmar_ci</option>
                                <option value="utf8_nopad_bin" title="Unicode, no-pad, binary">utf8_nopad_bin</option>
                                <option value="utf8_persian_ci" title="Persian, case-insensitive">utf8_persian_ci</option>
                                <option value="utf8_polish_ci" title="Polish, case-insensitive">utf8_polish_ci</option>
                                <option value="utf8_roman_ci" title="West European, case-insensitive">utf8_roman_ci</option>
                                <option value="utf8_romanian_ci" title="Romanian, case-insensitive">utf8_romanian_ci</option>
                                <option value="utf8_sinhala_ci" title="Sinhalese, case-insensitive">utf8_sinhala_ci</option>
                                <option value="utf8_slovak_ci" title="Slovak, case-insensitive">utf8_slovak_ci</option>
                                <option value="utf8_slovenian_ci" title="Slovenian, case-insensitive">utf8_slovenian_ci</option>
                                <option value="utf8_spanish2_ci" title="Spanish (traditional), case-insensitive">utf8_spanish2_ci</option>
                                <option value="utf8_spanish_ci" title="Spanish (modern), case-insensitive">utf8_spanish_ci</option>
                                <option value="utf8_swedish_ci" title="Swedish, case-insensitive">utf8_swedish_ci</option>
                                <option value="utf8_thai_520_w2" title="Thai (UCA 5.2.0), multi-level">utf8_thai_520_w2</option>
                                <option value="utf8_turkish_ci" title="Turkish, case-insensitive">utf8_turkish_ci</option>
                                <option value="utf8_unicode_520_ci" title="Unicode (UCA 5.2.0), case-insensitive">utf8_unicode_520_ci</option>
                                <option value="utf8_unicode_520_nopad_ci" title="Unicode (UCA 5.2.0), no-pad, case-insensitive">
                                    utf8_unicode_520_nopad_ci</option>
                                <option value="utf8_unicode_ci" title="Unicode, case-insensitive">utf8_unicode_ci</option>
                                <option value="utf8_unicode_nopad_ci" title="Unicode, no-pad, case-insensitive">utf8_unicode_nopad_ci</option>
                                <option value="utf8_vietnamese_ci" title="Vietnamese, case-insensitive">utf8_vietnamese_ci</option>
                            </optgroup>
                            <optgroup label="utf8mb4" title="UTF-8 Unicode">
                                <option value="utf8mb4_bin" title="Unicode (UCA 4.0.0), binary">utf8mb4_bin</option>
                                <option value="utf8mb4_croatian_ci" title="Croatian (UCA 4.0.0), case-insensitive">utf8mb4_croatian_ci</option>
                                <option value="utf8mb4_croatian_mysql561_ci" title="Croatian (MySQL 5.6.1), case-insensitive">
                                    utf8mb4_croatian_mysql561_ci</option>
                                <option value="utf8mb4_czech_ci" title="Czech (UCA 4.0.0), case-insensitive">utf8mb4_czech_ci</option>
                                <option value="utf8mb4_danish_ci" title="Danish (UCA 4.0.0), case-insensitive">utf8mb4_danish_ci</option>
                                <option value="utf8mb4_esperanto_ci" title="Esperanto (UCA 4.0.0), case-insensitive">utf8mb4_esperanto_ci</option>
                                <option value="utf8mb4_estonian_ci" title="Estonian (UCA 4.0.0), case-insensitive">utf8mb4_estonian_ci</option>
                                <option value="utf8mb4_general_ci" title="Unicode (UCA 4.0.0), case-insensitive">utf8mb4_general_ci</option>
                                <option value="utf8mb4_general_nopad_ci" title="Unicode (UCA 4.0.0), no-pad, case-insensitive">
                                    utf8mb4_general_nopad_ci</option>
                                <option value="utf8mb4_german2_ci" title="German (phone book order) (UCA 4.0.0), case-insensitive">
                                    utf8mb4_german2_ci</option>
                                <option value="utf8mb4_hungarian_ci" title="Hungarian (UCA 4.0.0), case-insensitive">utf8mb4_hungarian_ci</option>
                                <option value="utf8mb4_icelandic_ci" title="Icelandic (UCA 4.0.0), case-insensitive">utf8mb4_icelandic_ci</option>
                                <option value="utf8mb4_latvian_ci" title="Latvian (UCA 4.0.0), case-insensitive">utf8mb4_latvian_ci</option>
                                <option value="utf8mb4_lithuanian_ci" title="Lithuanian (UCA 4.0.0), case-insensitive">utf8mb4_lithuanian_ci
                                </option>
                                <option value="utf8mb4_myanmar_ci" title="Burmese (UCA 4.0.0), case-insensitive">utf8mb4_myanmar_ci</option>
                                <option value="utf8mb4_nopad_bin" title="Unicode (UCA 4.0.0), no-pad, binary">utf8mb4_nopad_bin</option>
                                <option value="utf8mb4_persian_ci" title="Persian (UCA 4.0.0), case-insensitive">utf8mb4_persian_ci</option>
                                <option value="utf8mb4_polish_ci" title="Polish (UCA 4.0.0), case-insensitive">utf8mb4_polish_ci</option>
                                <option value="utf8mb4_roman_ci" title="West European (UCA 4.0.0), case-insensitive">utf8mb4_roman_ci</option>
                                <option value="utf8mb4_romanian_ci" title="Romanian (UCA 4.0.0), case-insensitive">utf8mb4_romanian_ci</option>
                                <option value="utf8mb4_sinhala_ci" title="Sinhalese (UCA 4.0.0), case-insensitive">utf8mb4_sinhala_ci</option>
                                <option value="utf8mb4_slovak_ci" title="Slovak (UCA 4.0.0), case-insensitive">utf8mb4_slovak_ci</option>
                                <option value="utf8mb4_slovenian_ci" title="Slovenian (UCA 4.0.0), case-insensitive">utf8mb4_slovenian_ci</option>
                                <option value="utf8mb4_spanish2_ci" title="Spanish (traditional) (UCA 4.0.0), case-insensitive">utf8mb4_spanish2_ci
                                </option>
                                <option value="utf8mb4_spanish_ci" title="Spanish (modern) (UCA 4.0.0), case-insensitive">utf8mb4_spanish_ci
                                </option>
                                <option value="utf8mb4_swedish_ci" title="Swedish (UCA 4.0.0), case-insensitive">utf8mb4_swedish_ci</option>
                                <option value="utf8mb4_thai_520_w2" title="Thai (UCA 5.2.0), multi-level">utf8mb4_thai_520_w2</option>
                                <option value="utf8mb4_turkish_ci" title="Turkish (UCA 4.0.0), case-insensitive">utf8mb4_turkish_ci</option>
                                <option value="utf8mb4_unicode_520_ci" title="Unicode (UCA 5.2.0), case-insensitive">utf8mb4_unicode_520_ci</option>
                                <option value="utf8mb4_unicode_520_nopad_ci" title="Unicode (UCA 5.2.0), no-pad, case-insensitive">
                                    utf8mb4_unicode_520_nopad_ci</option>
                                <option value="utf8mb4_unicode_ci" title="Unicode (UCA 4.0.0), case-insensitive">utf8mb4_unicode_ci</option>
                                <option value="utf8mb4_unicode_nopad_ci" title="Unicode (UCA 4.0.0), no-pad, case-insensitive">
                                    utf8mb4_unicode_nopad_ci</option>
                                <option value="utf8mb4_vietnamese_ci" title="Vietnamese (UCA 4.0.0), case-insensitive">utf8mb4_vietnamese_ci
                                </option>
                            </optgroup>
                        </select>
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select name="columns[${rowCount}][field_attribute]" class=" form-select">
                            <option value=""></option>
                            <option value="BINARY">BINARY</option>
                            <option value="UNSIGNED">UNSIGNED</option>
                            <option value="UNSIGNED ZEROFILL">UNSIGNED ZEROFILL</option>
                            <option value="on update CURRENT_TIMESTAMP">on update CURRENT_TIMESTAMP</option>
                            <option value="COMPRESSED=zlib">COMPRESSED=zlib</option>
                        </select>
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select class="form-select" name="columns[${rowCount}][nullable]" id="columns_${rowCount}_nullable" onchange="handlenullChange(this, ${rowCount})" required>
                            <option value="1">Yes</option>
                            <option value="0">No</option>
                        </select>
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select name="columns[${rowCount}][index]" id="columns_${rowCount}_index" onchange="handleIndexChange(this, ${rowCount})" data-index="PRIMARY,0" class="form-select">
                            <option value="none_0">---</option>
                            <option value="primary_0" title="Primary">PRIMARY</option>
                            <option value="unique_0" title="Unique">UNIQUE</option>
                            <option value="index_0" title="Index">INDEX</option>
                            <option value="fulltext_0" title="Fulltext">FULLTEXT</option>
                            <option value="spatial_0" title="Spatial">SPATIAL</option>
                        </select>
                    </div>
                    <div class="col-lg-1 col-md-4">
                        <select name="columns[${rowCount}][auto_increment]" id="columns_${rowCount}_auto_increment" onchange="handleAutoIncrementChange(this, ${rowCount})" class="form-select">
                            <option value="yes" >Yes</option>
                            <option value="no" selected>No</option>
                        </select>
                    </div>
                    <div class="col-lg-2 col-md-4">
                        <textarea type="text" class="form-control" name="columns[${rowCount}][comments]" placeholder="Comments"></textarea>
                    </div>
                    <div class="col-lg-1">
                        <button type="button" class="btn btn-danger" onclick="removeRow(this)">Remove</button>
                    </div>
                </div>
            `;
        // Append the new row to the column_details container
        columnDetails.appendChild(row);

    }

    // Reset the column count to 1
    document.getElementById('column_count').value = 1;

}

function removeRow(button) {
    button.closest('.row').remove();
}

function handleIndexChange(selectElement, rowNum) {
    var autoIncrementSelect = document.getElementById(`columns_${rowNum}_auto_increment`);
    if (selectElement.value === 'primary_0') {
        autoIncrementSelect.value = 'yes';
        autoIncrementSelect.dispatchEvent(new Event('change')); // Trigger the change event to update the select visually
    }
    console.log(`Index for row ${rowNum} changed to ${selectElement.value}`);
}
function handlenullChange(selectElement, rowNum) {
    var default_type = document.getElementById(`columns_${rowNum}_default`);
    if (selectElement.value === 'yes') {
        default_type.value = '';
        default_type.dispatchEvent(new Event('change')); // Trigger the change event to update the select visually
    }
    console.log(`Index for row ${rowNum} changed to ${selectElement.value}`);
}

function handleAutoIncrementChange(selectElement, rowNum) {
    var indexSelect = document.getElementById(`columns_${rowNum}_index`);
    var default_type = document.getElementById(`columns_${rowNum}_default`);
    if (selectElement.value === 'yes') {
        indexSelect.value = 'primary_0';
        default_type.value = '';
        indexSelect.dispatchEvent(new Event('change')); // Trigger the change event to update the select visually
        default_type.dispatchEvent(new Event('change')); // Trigger the change event to update the select visually
    }
    console.log(`Auto increment for row ${rowNum} changed to ${selectElement.value}`);
}

function toggletype(selectElement, rowNum) {
    const inputElement = document.getElementById(`columns_${rowNum}_length`);
    console.log('Input Element:', inputElement);
    if (inputElement) {
        if (selectElement.value === 'integer' || selectElement.value === 'string') {
            inputElement.setAttribute('required', 'required');
            inputElement.value = 10;
        } else {
            inputElement.removeAttribute('required');
        }
    } else {
        console.error('Input element not found with ID:', inputId);
    }
}

function toggleInput(selectElement, rowNum) {  //
    const inputElement = document.getElementById(`columns_${rowNum}_default_value`);
    console.log('Input Element:', inputElement);
    if (selectElement.value === "USER_DEFINED") {
        inputElement.style.display = "inline-block";
    } else {
        inputElement.style.display = "none";
    }
}