forked from fitak/fitak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sql-structure.sql
executable file
·102 lines (84 loc) · 3 KB
/
sql-structure.sql
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
-- Adminer 3.6.1 MySQL dump
SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = 'SYSTEM';
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `data`;
CREATE TABLE `data` (
`id` bigint(20) NOT NULL,
`parent_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) NOT NULL,
`message` text COLLATE utf8_czech_ci NOT NULL,
`created_time` datetime NOT NULL,
`updated_time` datetime DEFAULT NULL,
`comments` int(11) DEFAULT NULL,
`likes` int(11) DEFAULT NULL,
`from_name` varchar(250) COLLATE utf8_czech_ci NOT NULL,
`from_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
FULLTEXT KEY `message` (`message`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `data_tags`;
CREATE TABLE `data_tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`data_id` bigint(20) NOT NULL,
`tags_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `data_id` (`data_id`),
KEY `tags_id` (`tags_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `groups`;
CREATE TABLE `groups` (
`id` bigint(20) NOT NULL,
`name` varchar(250) COLLATE utf8_czech_ci NOT NULL,
`closed` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `ip`;
CREATE TABLE `ip` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(150) COLLATE utf8_czech_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `likes`;
CREATE TABLE `likes` (
`id` bigint(20) NOT NULL,
`message_id` bigint(20) NOT NULL,
`from_name` varchar(250) COLLATE utf8_czech_ci NOT NULL,
`from_id` bigint(20) NOT NULL,
KEY `id` (`id`),
KEY `message_id` (`message_id`),
KEY `from_id` (`from_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `tags`;
CREATE TABLE `tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(250) COLLATE utf8_czech_ci NOT NULL,
`count` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(250) COLLATE utf8_czech_ci NOT NULL,
`expiration` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` text COLLATE utf8_czech_ci NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
ALTER TABLE `data`
ADD `type` enum('status','video','link','photo') NOT NULL,
ADD `link` varchar(500) NOT NULL AFTER `type`,
ADD `name` varchar(500) NOT NULL AFTER `link`,
ADD `caption` varchar(500) NOT NULL AFTER `name`,
ADD `description` text NOT NULL AFTER `caption`,
ADD `picture` varchar(500) NOT NULL AFTER `description`,
ADD `source` varchar(500) NOT NULL AFTER `picture`,
COMMENT='';
-- 2013-02-24 18:19:21