c10fa98d0a
Restore original migrations (001-120) to fix schema_migrations version mismatch * Restore original migrations (001-120) to fix schema_migrations version mismatch The previous migration collapse broke deployed databases because: - Dev database was at version 120 (the real remove_text_extraction migration) - Main had collapsed migrations (001-012) + stub files (119_stub, 120_stub) - The migrate tool couldn't find version 119/120 with matching content This commit restores the original 27 migrations (versions 001-120) from before the collapse, ensuring backward compatibility with existing databases.
19 lines
692 B
SQL
19 lines
692 B
SQL
CREATE TABLE results (
|
|
id uuid primary key DEFAULT uuid_generate_v7(),
|
|
textEntryId uuid not null,
|
|
queryId uuid not null,
|
|
value TEXT not null,
|
|
queryVersion int not null,
|
|
foreign key (queryId) references queries(queryId),
|
|
foreign key (textEntryId) references documentTextExtractions(id),
|
|
foreign key (queryId, queryVersion) references queryVersions(queryId, versionId)
|
|
);
|
|
|
|
CREATE TABLE resultDependencies (
|
|
resultId uuid not null,
|
|
requiredResultId uuid not null,
|
|
foreign key (resultId) references results(id),
|
|
foreign key (requiredResultId) references results(id),
|
|
CONSTRAINT result_not_self_dependent CHECK (resultId != requiredResultId)
|
|
);
|