mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
fix(cassandra): do not add 2nd id column
This commit is contained in:
@@ -93,6 +93,8 @@ const driver = {
|
||||
: mysqlSplitterOptions,
|
||||
adaptTableInfo(table) {
|
||||
if (!table.primaryKey && !table.sortingKey) {
|
||||
const hasIdColumn = table.columns.some((x) => x.columnName == 'id');
|
||||
|
||||
return {
|
||||
...table,
|
||||
primaryKey: {
|
||||
@@ -103,10 +105,14 @@ const driver = {
|
||||
],
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
columnName: 'id',
|
||||
dataType: 'uuid',
|
||||
},
|
||||
...(!hasIdColumn
|
||||
? [
|
||||
{
|
||||
columnName: 'id',
|
||||
dataType: 'uuid',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...table.columns,
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user