Make signals include the object they are attached to (pool, report)
This means pushing the types into the common types module, which required a refactor of a bunch of other libraries.
This commit is contained in:
parent
ddc63bfa91
commit
9b6cacda0e
18 changed files with 1135 additions and 262 deletions
12
db/migrations/00124_signal_publicreport_pool.sql
Normal file
12
db/migrations/00124_signal_publicreport_pool.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- +goose Up
|
||||
ALTER TABLE signal ADD COLUMN feature_pool_feature_id INTEGER REFERENCES feature_pool(feature_id);
|
||||
ALTER TABLE signal ADD COLUMN report_id INTEGER REFERENCES publicreport.report(id);
|
||||
ALTER TABLE signal
|
||||
ADD CONSTRAINT check_exclusive_reference
|
||||
CHECK (
|
||||
(feature_pool_feature_id IS NULL OR report_id IS NULL)
|
||||
);
|
||||
-- +goose Down
|
||||
ALTER TABLE signal DROP CONSTRAINT check_exclusive_reference;
|
||||
ALTER TABLE signal DROP COLUMN report_id;
|
||||
ALTER TABLE signal DROP COLUMN feature_pool_feature_id;
|
||||
Loading…
Add table
Add a link
Reference in a new issue