* * delete broadcast views when user is deleted (for tests)
This commit is contained in:
parent
5af9d759f2
commit
2da5b3804e
|
|
@ -286,4 +286,5 @@ signing.sql
|
|||
optimized_redeemption.sql
|
||||
optimized_redemption_warn_mode.sql
|
||||
affiliate_partners2.sql
|
||||
broadcast_notifications.sql
|
||||
broadcast_notifications.sql
|
||||
broadcast_notifications_fk.sql
|
||||
|
|
@ -11,7 +11,7 @@ CREATE TABLE broadcast_notifications (
|
|||
|
||||
CREATE TABLE broadcast_notification_views (
|
||||
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id varchar(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
user_id varchar(64) NOT NULL REFERENCES users(id),
|
||||
broadcast_notification_id varchar(64) NOT NULL REFERENCES broadcast_notifications(id) ON DELETE CASCADE,
|
||||
view_count INTEGER DEFAULT 0,
|
||||
active_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE broadcast_notification_views DROP CONSTRAINT broadcast_notification_views_user_id_fkey;
|
||||
ALTER TABLE broadcast_notification_views ADD CONSTRAINT broadcast_notification_views_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
|
||||
Loading…
Reference in New Issue