fix(cassandra): do not add 2nd id column

This commit is contained in:
Nybkox
2025-02-04 11:47:35 +01:00
parent ac4e411d41
commit 38ce62185e

View File

@@ -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,
],
};