mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
vfk editor - auto select PK
This commit is contained in:
parent
7953186e03
commit
64c8d4bdca
@ -50,6 +50,7 @@
|
||||
|
||||
// $: console.log('conid, database', conid, database);
|
||||
// $: console.log('$dbInfo?.tables', $dbInfo?.tables);
|
||||
// $: console.log('tableList', tableList);
|
||||
</script>
|
||||
|
||||
<FormProvider>
|
||||
@ -73,6 +74,17 @@
|
||||
const name = fullNameFromString(e.detail);
|
||||
refTableName = name.pureName;
|
||||
refSchemaName = name.schemaName;
|
||||
if (columns?.length == 1) {
|
||||
const table = $dbInfo?.tables?.find(x => x.pureName == refTableName && x.schemaName == refSchemaName);
|
||||
if (table?.primaryKey?.columns?.length == 1) {
|
||||
columns = [
|
||||
{
|
||||
...columns[0],
|
||||
refColumnName: table.primaryKey.columns[0].columnName,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user