if we come across these, make them BIGINT. mysql/mariadb can't index TEXT
authorJason Etheridge <jason@equinoxinitiative.org>
Wed, 15 Apr 2020 20:32:46 +0000 (16:32 -0400)
committerJason Etheridge <jason@equinoxinitiative.org>
Wed, 15 Apr 2020 20:33:06 +0000 (16:33 -0400)
Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>

kmig.d/bin/csv2mysql

index f131f5b..840126a 100755 (executable)
@@ -112,7 +112,11 @@ sub write_sql_table {
                $col_info =~ s/^\$VAR1 = //;
                print $sql "ALTER TABLE $cfg->{table_name} ADD COLUMN ";
                print $sql "l_" unless $cfg->{no_legacy_prefix} or $column->{'header'} =~ /^x_/ or $column->{'header'} =~ /^l_/;
-        print $sql "$cn TEXT; ";
+        if ($column->{'header'} eq 'x_egid' || $column->{'header'} eq 'x_hseq') {
+            print $sql "$cn BIGINT; ";
+        } else {
+            print $sql "$cn TEXT; ";
+        }
         print $sql " /*\n         $col_info   */\n";
        }
        foreach my $cn (@indices) {