mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 00:46:01 +00:00
fk editor
This commit is contained in:
@@ -10,6 +10,18 @@ export function generateTablePairingId(table: TableInfo): TableInfo {
|
||||
...col,
|
||||
pairingId: col.pairingId || uuidv1(),
|
||||
})),
|
||||
foreignKeys: table.foreignKeys.map(cnt => ({
|
||||
...cnt,
|
||||
pairingId: cnt.pairingId || uuidv1(),
|
||||
})),
|
||||
checks: table.checks.map(cnt => ({
|
||||
...cnt,
|
||||
pairingId: cnt.pairingId || uuidv1(),
|
||||
})),
|
||||
indexes: table.indexes.map(cnt => ({
|
||||
...cnt,
|
||||
pairingId: cnt.pairingId || uuidv1(),
|
||||
})),
|
||||
pairingId: table.pairingId || uuidv1(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,6 +21,13 @@ export function fullNameToString({ schemaName, pureName }) {
|
||||
return pureName;
|
||||
}
|
||||
|
||||
export function fullNameToLabel({ schemaName, pureName }) {
|
||||
if (schemaName) {
|
||||
return `${schemaName}.${pureName}`;
|
||||
}
|
||||
return pureName;
|
||||
}
|
||||
|
||||
export function quoteFullName(dialect, { schemaName, pureName }) {
|
||||
if (schemaName) return `${dialect.quoteIdentifier(schemaName)}.${dialect.quoteIdentifier(pureName)}`;
|
||||
return `${dialect.quoteIdentifier(pureName)}`;
|
||||
|
||||
Reference in New Issue
Block a user