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