puerta/cmd/db/migrations/2023-04-15-add-subscriptions.sql
2023-04-16 15:17:36 -06:00

12 lines
272 B
SQL

CREATE TABLE subscription(
user INTEGER NOT NULL,
data TEXT NOT NULL,
FOREIGN KEY(user) REFERENCES user(id) ON DELETE CASCADE
);
CREATE INDEX subscription_user ON subscription(user);
ALTER TABLE user ADD COLUMN receives_notifications BOOLEAN DEFAULT 0 NOT NULL;