Files
rustpad/migrations/postgres/0007_user_resources.sql

11 lines
398 B
SQL

CREATE TABLE user_workspaces (
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
workspace_id BIGINT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
PRIMARY KEY (user_id, workspace_id)
);
CREATE TABLE user_pads (
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
pad_id BIGINT NOT NULL REFERENCES pads(id) ON DELETE CASCADE,
PRIMARY KEY (user_id, pad_id)
);