mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 06:46:00 +00:00
SYNC: multi-sql
This commit is contained in:
committed by
Diflow
parent
8bdd24aa1e
commit
bdd9dc8c9d
@@ -92,11 +92,12 @@ const driver = {
|
||||
? { ...mysqlSplitterOptions, ignoreComments: true, preventSingleLineSplit: true }
|
||||
: mysqlSplitterOptions,
|
||||
adaptTableInfo(table) {
|
||||
if (!table.primaryKey && !table.sortingKey) {
|
||||
const hasIdColumn = table.columns.some((x) => x.columnName == 'id');
|
||||
const baseAdapted = driverBase.adaptTableInfo(table);
|
||||
if (!baseAdapted.primaryKey && !baseAdapted.sortingKey) {
|
||||
const hasIdColumn = baseAdapted.columns.some((x) => x.columnName == 'id');
|
||||
|
||||
return {
|
||||
...table,
|
||||
...baseAdapted,
|
||||
primaryKey: {
|
||||
columns: [
|
||||
{
|
||||
@@ -113,11 +114,11 @@ const driver = {
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...table.columns,
|
||||
...baseAdapted.columns,
|
||||
],
|
||||
};
|
||||
}
|
||||
return table;
|
||||
return baseAdapted;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user