-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_tables.twig
78 lines (71 loc) · 3.02 KB
/
create_tables.twig
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
CREATE TABLE `{{ prefix }}users` (
`id` bigint(15) NOT NULL auto_increment,
`username` varchar(180) default NULL,
`email` varchar(180) default NULL,
`full_name` varchar(180) default NULL,
`bio` varchar(180) default NULL,
`url` varchar(180) default NULL,
`points` int(9) default '0',
`invites` int(9) default '2',
`password` varchar(180) default NULL,
`date_added` datetime default NULL,
`date_joined` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}users_password_reset` (
`user_id` bigint(15) unsigned NOT NULL,
`reset_code` char(32) DEFAULT NULL,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}items` (
`id` int(10) NOT NULL auto_increment,
`user_id` bigint(15) NOT NULL default '0',
`title` varchar(140) default NULL,
`content` text default NULL,
`image` varchar(140) default NULL,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}invites` (
`id` int(11) NOT NULL auto_increment,
`user_id` bigint(15) NOT NULL,
`email` varchar(50) default '',
`code` varchar(11) default NULL,
`result` int(1) default '0',
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}log` (
`id` int(11) NOT NULL auto_increment,
`user_id` bigint(15) NOT NULL default '0',
`object_type` varchar(50) default NULL,
`object_id` varchar(50) default NULL,
`action` varchar(50) NOT NULL default '',
`params` varchar(50) default NULL,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}comments` (
`id` int(11) NOT NULL auto_increment,
`user_id` bigint(15) NOT NULL default '0',
`item_id` int(11) NOT NULL default '0',
`content` text NOT NULL,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}likes` (
`id` int(11) NOT NULL auto_increment,
`user_id` bigint(15) NOT NULL default '0',
`item_id` int(11) NOT NULL default '0',
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE `{{ prefix }}friends` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(15) NOT NULL DEFAULT '0',
`friend_user_id` bigint(15) NOT NULL DEFAULT '0',
`status` tinyint(1) DEFAULT '0',
`date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_updated` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;