mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 05:36:00 +00:00
fixes sqlite autoincrement column creation
This commit is contained in:
@@ -18,7 +18,23 @@ class Dumper extends SqlDumper {
|
||||
}
|
||||
|
||||
selectScopeIdentity() {
|
||||
this.put('^select last_insert_rowid()')
|
||||
this.put('^select last_insert_rowid()');
|
||||
}
|
||||
|
||||
columnDefinition(column, flags) {
|
||||
if (column.dataType && column.dataType.toLowerCase().includes('int') && column.notNull && column.autoIncrement) {
|
||||
this.put('^integer ^primary ^key ^autoincrement');
|
||||
return;
|
||||
}
|
||||
super.columnDefinition(column, flags);
|
||||
}
|
||||
|
||||
createTablePrimaryKeyCore(table) {
|
||||
const column = table.columns.find((x) => x.autoIncrement);
|
||||
if (column && column.dataType && column.dataType.toLowerCase().includes('int') && column.notNull) {
|
||||
return;
|
||||
}
|
||||
super.createTablePrimaryKeyCore(table);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user