-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
29 lines (27 loc) · 1.15 KB
/
Copy pathdatabase.sql
File metadata and controls
29 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CREATE TABLE IF NOT EXISTS `relationships` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`player1` int(11) NOT NULL,
`player2` int(11) NOT NULL,
`status` int(11) NOT NULL DEFAULT '0',
`last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_relationship` (`player1`,`player2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `relationship_photos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`relationship_id` int(11) NOT NULL,
`photo_url` varchar(255) NOT NULL,
`uploaded_by` int(11) NOT NULL,
`uploaded_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `relationship_id` (`relationship_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `relationship_gifts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`relationship_id` int(11) NOT NULL,
`gift_name` varchar(255) NOT NULL,
`gifted_by` int(11) NOT NULL,
`gifted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `relationship_id` (`relationship_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;