actaeon/migrations/sqls/20240331021022-create-friend-requests-up.sql

13 lines
343 B
MySQL
Raw Normal View History

CREATE TABLE actaeon_friend_requests (
uuid CHAR(36) PRIMARY KEY,
user INT NOT NULL,
friend INT NOT NULL,
createdDate TIMESTAMP NOT NULL,
FOREIGN KEY (user) REFERENCES aime_user(id)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (friend) REFERENCES aime_user(id)
ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE KEY (user, friend)
);