· 8 years ago · May 03, 2018, 12:32 PM
1create table if not exists `meta` (
2 `meta_id` int(11) not null auto_increment,
3 `_uuid` varchar(36) not null default '00000000-0000-0000-0000-000000000000',
4 `_committed` tinyint(1) not null default '0',
5 `_unique_name` varchar(255) character set utf8 collate utf8_general_ci not null,
6 `_time_created` int(11) not null,
7 `_time_updated` int(11) not null,
8 `_author` varchar(255) character set utf8 collate utf8_general_ci default null,
9 `_comment` text not null,
10 primary key (`meta_id`)
11) engine = MyISAM character set utf8 collate utf8_general_ci comment = 'The global meta data table. Provides basic information as well as a unique ID.';
12
13
14create table if not exists `media_meta` (
15 `media_id` int(11) not null,
16 `meta_id` int(11) not null,
17 primary key (`media_id`, `meta_id`)
18) engine = MyISAM character set utf8 collate utf8_general_ci;
19
20
21create table if not exists `media` (
22 `media_id` int(11) not null auto_increment,
23 `name` varchar(255) character set utf8 collate utf8_general_ci not null,
24 `desc_full` text character set utf8 collate utf8_general_ci not null,
25 primary key (`media_id`)
26) engine = MyISAM character set utf8 collate utf8_general_ci comment = 'The generic information table of media items.';
27
28
29create table if not exists `media_file` (
30 `media_id` int(11) not null,
31 `file_id` int(11) not null,
32 primary key (`media_id`, `file_id`)
33) engine = MyISAM character set utf8 collate utf8_general_ci;
34
35
36create table if not exists `file` (
37 `file_id` int(11) not null auto_increment,
38 `file_name` varchar(255) character set utf8 collate utf8_general_ci not null,
39 `file_mime` varchar(255) character set utf8 collate utf8_general_ci not null default 'application/x-unknown-mime-type',
40 `file_path` varchar(255) character set utf8 collate utf8_general_ci not null,
41 `full_path` varchar(255) character set utf8 collate utf8_general_ci not null,
42 `raw_name` varchar(255) character set utf8 collate utf8_general_ci not null,
43 `orig_name` varchar(255) character set utf8 collate utf8_general_ci not null,
44 `file_ext` varchar(63) character set utf8 collate utf8_general_ci not null,
45 `file_size` int(11) not null,
46 `is_image` tinyint(1) not null default '0',
47 `image_width` smallint(6) default null,
48 `image_height` smallint(6) default null,
49 primary key (`file_id`)
50) engine = MyISAM character set utf8 collate utf8_general_ci comment = 'The table of individual files. The entries should be joined with the `media` table to be meaningful.';
51
52
53create table if not exists `file_meta` (
54 `file_id` int(11) not null,
55 `meta_id` int(11) not null,
56 primary key (`file_id`, `meta_id`)
57) engine = MyISAM character set utf8 collate utf8_general_ci;
58
59
60create table if not exists `event` (
61 `event_id` int(11) not null auto_increment,
62 `title` varchar(255) character set utf8 collate utf8_general_ci not null,
63 `time` varchar(5) character set utf8 collate utf8_general_ci,
64 `time_desc` varchar(255) character set utf8 collate utf8_general_ci,
65 `location` varchar(255) character set utf8 collate utf8_general_ci not null,
66 `city` varchar(255) character set utf8 collate utf8_general_ci not null,
67 `price` text character set utf8 collate utf8_general_ci not null,
68 `info` text character set utf8 collate utf8_general_ci not null,
69 `info_short` text character set utf8 collate utf8_general_ci,
70 `catogory` varchar(11) character set utf8 collate utf8_general_ci not null,
71 `link` varchar(255) character set utf8 collate utf8_general_ci,
72 `youtube` varchar(255) character set utf8 collate utf8_general_ci,
73 `coordinates` varchar(19) character set utf8 collate utf8_general_ci,
74 `show_details` tinyint(1) not null default '1',
75 `uitgelicht` tinyint(1) not null default '0',
76 `createyourworld` tinyint(1) not null default '0',
77 `media_id` int(11) not null,
78 primary key (`event_id`)
79) engine = MyISAM character set utf8 collate utf8_general_ci comment = 'The events. Â Could be modified later to include support for multiple dates.';
80
81
82create table if not exists `event_media` (
83 `event_id` int(11) not null,
84 `media_id` int(11) not null,
85 primary key (`event_id`, `media_id`)
86) engine = MyISAM character set utf8 collate utf8_general_ci;
87
88create table if not exists `event_date` (
89 `event_id` int(11) not null,
90 `date_id` int(11) not null,
91 primary key (`event_id`, `date_id`)
92) engine = MyISAM character set utf8 collate utf8_general_ci;
93
94create table if not exists `date` (
95 `date_id` int(11) not null auto_increment,
96 `date_from` int(11) not null,
97 `date_to` int(11),
98 primary key (`date_id`)
99) engine = MyISAM character set utf8 collate utf8_general_ci comment = 'The dates during which events occur.';
100
101create table if not exists `date_meta` (
102 `date_id` int(11) not null,
103 `meta_id` int(11) not null,
104 primary key (`date_id`, `meta_id`)
105) engine = MyISAM character set utf8 collate utf8_general_ci;