mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
fix(db): generator captures inline UNIQUE constraints
SqliteSchemaHelper.getIndexes() drops every unnamed sqlite_autoindex_ entry before entity-generator ever sees it, so a table-level UNIQUE(...) constraint with no separate named CREATE UNIQUE INDEX (settings' UNIQUE(user_id, key) among ~40 others) never reached the generated entity's uniques: metadata. Adds a general RULE9_addImplicitUniqueConstraints (skips a column set identical to the table's own primary key — AppSettings.key/Addons.id noise) fed by a PRAGMA index_list/index_info scan, and regenerates every entity.
This commit is contained in:
@@ -20,6 +20,7 @@ export const PluginEntityMetadataSchema = defineEntity({
|
||||
properties: ['plugin_id', 'entity_type', 'entity_id'],
|
||||
},
|
||||
],
|
||||
uniques: [{ properties: ['plugin_id', 'entity_type', 'entity_id', 'key'] }],
|
||||
properties: {
|
||||
id: p.integer().primary(),
|
||||
plugin_id: p.text(),
|
||||
|
||||
Reference in New Issue
Block a user