34760-vm/db/migrations/008_create_user_roles_table.sql
Flatlogic Bot a29976994c v2
2025-10-07 16:34:00 +00:00

8 lines
265 B
SQL

CREATE TABLE IF NOT EXISTS user_roles (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
role_id INT NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (role_id) REFERENCES roles(id) ON DELETE CASCADE
);