2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Up
|
2017-12-19 20:14:41 +00:00
|
|
|
ALTER TABLE blocks
|
2019-01-22 12:15:29 +00:00
|
|
|
ADD COLUMN node_id INTEGER NOT NULL,
|
2017-12-19 20:14:41 +00:00
|
|
|
ADD CONSTRAINT node_fk
|
|
|
|
FOREIGN KEY (node_id)
|
2019-03-18 22:21:31 +00:00
|
|
|
REFERENCES nodes (id)
|
|
|
|
ON DELETE CASCADE;
|
2017-12-19 20:14:41 +00:00
|
|
|
|
2019-01-22 12:15:29 +00:00
|
|
|
-- +goose Down
|
|
|
|
ALTER TABLE blocks
|
2019-01-22 14:07:11 +00:00
|
|
|
DROP COLUMN node_id;
|