You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
612 B
14 lines
612 B
USE dating_app;
|
|
|
|
CREATE TABLE IF NOT EXISTS user_interests (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
user_id INT NOT NULL,
|
|
name VARCHAR(120) NOT NULL,
|
|
created_at DATETIME NOT NULL,
|
|
CONSTRAINT uq_user_interest_name UNIQUE (user_id, name),
|
|
CONSTRAINT fk_user_interests_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
|
INDEX ix_user_interests_user (user_id)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
-- There is deliberately no maximum row count per user. The API enforces only
|
|
-- the onboarding minimum of two interests when a list is submitted.
|
|
|