1 DROP TABLE IF EXISTS `batches`;
2 CREATE TABLE `batches` (
3 `id` int(11) NOT NULL auto_increment,
4 `name` varchar(50) NOT NULL default '',
5 `last_update` int(11) NOT NULL default '0',
6 `message` text NOT NULL,
7 `abort_message` text NOT NULL,
9 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
11 DROP TABLE IF EXISTS `channels`;
12 CREATE TABLE `channels` (
13 `id` int(11) NOT NULL auto_increment,
14 `display_name` varchar(100) NOT NULL default '',
15 `xmltvid` varchar(100) NOT NULL default '',
16 `chgroup` varchar(100) NOT NULL,
17 `grabber` varchar(20) NOT NULL default '',
18 `export` tinyint(1) NOT NULL default '0',
19 `grabber_info` varchar(100) NOT NULL default '',
20 `logo` tinyint(4) NOT NULL default '0',
21 `def_pty` varchar(20) default '',
22 `def_cat` varchar(20) default '',
23 `sched_lang` varchar(4) NOT NULL default '',
24 `empty_ok` tinyint(1) NOT NULL default '0',
25 `url` varchar(100) default NULL,
26 `allowcredits` tinyint(1) NOT NULL default '0',
28 KEY `chgroup` (`chgroup`)
29 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
31 DROP TABLE IF EXISTS `channelgroups`;
32 CREATE TABLE `channelgroups` (
33 `abr` varchar(24) character set latin1 NOT NULL,
34 `display_name` varchar(100) character set latin1 NOT NULL,
35 `position` tinyint(10) unsigned NOT NULL,
36 `sortby` varchar(32) NOT NULL,
37 `hidden` tinyint(1) NOT NULL default '0',
39 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
41 DROP TABLE IF EXISTS `files`;
42 CREATE TABLE `files` (
43 `id` int(11) NOT NULL auto_increment,
44 `channelid` int(11) NOT NULL default '0',
45 `filename` varchar(80) NOT NULL default '',
46 `successful` tinyint(1) default NULL,
47 `message` text NOT NULL,
48 `earliestdate` datetime default NULL,
49 `latestdate` datetime default NULL,
50 `md5sum` varchar(33) NOT NULL default '',
52 KEY `channelid` (`channelid`),
53 CONSTRAINT `files_ibfk_1` FOREIGN KEY (`channelid`) REFERENCES `channels` (`id`)
54 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
56 DROP TABLE IF EXISTS `programs`;
57 CREATE TABLE `programs` (
58 `category` varchar(100) NOT NULL default '',
59 `channel_id` int(11) NOT NULL default '0',
60 `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
61 `end_time` datetime default '0000-00-00 00:00:00',
62 `schedule_id` varchar(100) NOT NULL,
63 `title_id` varchar(100) NOT NULL,
64 `title` varchar(100) NOT NULL default '',
65 `subtitle` mediumtext,
66 `description` mediumtext,
67 `batch_id` int(11) NOT NULL default '0',
68 `program_type` varchar(20) default '',
69 `episode` varchar(20) default NULL,
70 `production_date` date default NULL,
71 `aspect` enum('unknown','4:3','16:9') NOT NULL default 'unknown',
72 `quality` varchar(40) NOT NULL,
73 `stereo` varchar(40) NOT NULL,
74 `rating` varchar(20) NOT NULL,
75 `directors` text NOT NULL,
76 `actors` text NOT NULL,
77 `writers` text NOT NULL,
78 `adapters` text NOT NULL,
79 `producers` text NOT NULL,
80 `presenters` text NOT NULL,
81 `commentators` text NOT NULL,
82 `guests` text NOT NULL,
83 `url` varchar(100) default NULL,
84 `url_image_main` varchar(100) default NULL,
85 `url_image_thumbnail` varchar(100) default NULL,
86 `url_image_icon` varchar(100) default NULL,
87 PRIMARY KEY (`channel_id`,`start_time`),
88 KEY `batch` (`batch_id`,`start_time`),
89 CONSTRAINT `programs_ibfk_2` FOREIGN KEY (`batch_id`) REFERENCES `batches` (`id`),
90 CONSTRAINT `programs_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`)
91 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
93 DROP TABLE IF EXISTS `state`;
94 CREATE TABLE `state` (
95 `name` varchar(60) NOT NULL default '',
98 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
100 DROP TABLE IF EXISTS `trans_cat`;
101 CREATE TABLE `trans_cat` (
102 `type` varchar(50) NOT NULL,
103 `original` varchar(50) NOT NULL default '',
104 `category` varchar(20) default '',
105 `program_type` varchar(50) default '',
106 PRIMARY KEY (`type`,`original`)
107 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
109 DROP TABLE IF EXISTS `languagestrings`;
110 CREATE TABLE `languagestrings` (
111 `module` varchar(32) NOT NULL default '',
112 `strname` varchar(32) NOT NULL default '',
113 `strvalue` text NOT NULL,
114 `language` varchar(4) NOT NULL default ''
115 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
117 DROP TABLE IF EXISTS `epgservers`;
118 CREATE TABLE `epgservers` (
119 `id` int(11) unsigned NOT NULL auto_increment,
120 `active` tinyint(1) unsigned NOT NULL default '0',
121 `name` varchar(100) NOT NULL default '',
122 `description` varchar(100) NOT NULL default '',
123 `vendor` varchar(100) NOT NULL default '',
124 `type` varchar(100) NOT NULL default '',
126 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
128 DROP TABLE IF EXISTS `dvb_cat`;
129 CREATE TABLE `dvb_cat` (
130 `category` varchar(100) default NULL,
131 `dvb_category` varchar(20) NOT NULL,
132 `description` varchar(100) NOT NULL,
133 PRIMARY KEY (`dvb_category`)
134 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
136 DROP TABLE IF EXISTS `networks`;
137 CREATE TABLE `networks` (
138 `id` int(11) unsigned NOT NULL auto_increment,
139 `nid` int(11) NOT NULL,
140 `active` tinyint(1) unsigned NOT NULL default '0',
141 `epgserver` int(11) unsigned NOT NULL,
142 `name` varchar(100) NOT NULL,
143 `operator` varchar(100) NOT NULL default '',
144 `description` varchar(100) NOT NULL default '',
145 `charset` varchar(100) NOT NULL default '',
146 `type` enum('DVB-C','DVB-S','DVB-T','IPTV','GENERIC') NOT NULL,
148 KEY `epgserver` (`epgserver`),
149 CONSTRAINT `networks_ibfk_1` FOREIGN KEY (`epgserver`) REFERENCES `epgservers` (`id`)
150 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
152 DROP TABLE IF EXISTS `services`;
153 CREATE TABLE `services` (
154 `id` int(11) unsigned NOT NULL auto_increment,
155 `dbchid` int(11) unsigned NOT NULL,
156 `active` tinyint(1) unsigned NOT NULL default '0',
157 `network` int(11) unsigned NOT NULL,
158 `transportstream` int(11) unsigned NOT NULL,
159 `servicename` varchar(100) NOT NULL default '',
160 `logicalchannelnumber` int(11) unsigned NOT NULL,
161 `serviceid` int(11) unsigned NOT NULL,
162 `description` varchar(100) NOT NULL default '',
163 `sourceaddress` varchar(32) NOT NULL,
164 `sourceport` int(10) unsigned NOT NULL,
165 `pidvideo` int(10) unsigned NOT NULL,
166 `pidaudio` int(10) unsigned NOT NULL,
167 `nvod` varchar(100) NOT NULL,
168 `servicetypeid` int(11) unsigned NOT NULL,
169 `lasteventid` int(11) unsigned NOT NULL,
171 KEY `transportstream` (`transportstream`),
172 KEY `dbchid` (`dbchid`)
173 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
175 DROP TABLE IF EXISTS `transportstreams`;
176 CREATE TABLE `transportstreams` (
177 `id` int(11) unsigned NOT NULL auto_increment,
178 `tsid` int(11) NOT NULL,
179 `active` tinyint(1) unsigned NOT NULL default '0',
180 `network` int(11) unsigned NOT NULL,
181 `description` varchar(100) NOT NULL default '',
182 `muxmainprotocol` varchar(100) NOT NULL default '',
183 `eitmaxbw` varchar(100) NOT NULL default '',
184 `simaxbw` varchar(100) NOT NULL default '',
185 `dsystype` varchar(100) NOT NULL,
186 `dsysfrequency` varchar(100) NOT NULL,
187 `dsysmodulationschemeid` varchar(100) NOT NULL,
188 `dsysfecouterschemeid` varchar(100) NOT NULL,
189 `dsysfecinnerschemeid` varchar(100) NOT NULL,
190 `dsyssymbolrate` varchar(100) NOT NULL,
192 KEY `network` (`network`),
193 CONSTRAINT `transportstreams_ibfk_1` FOREIGN KEY (`network`) REFERENCES `networks` (`id`)
194 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
196 DROP TABLE IF EXISTS `admins`;
197 CREATE TABLE `admins` (
198 `username` varchar(32) NOT NULL default '',
199 `password` varchar(64) NOT NULL,
200 `fullname` varchar(64) NOT NULL default '',
201 `email` varchar(64) NOT NULL default '',
202 `language` varchar(32) NOT NULL default '',
203 `ismaster` tinyint(1) unsigned NOT NULL default '0',
204 `roleeditor` tinyint(1) unsigned NOT NULL default '0',
205 UNIQUE KEY `username` (`username`)
206 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
208 DROP TABLE IF EXISTS `augmenterrules`;
209 CREATE TABLE `augmenterrules` (
210 `channel_id` int(11) NOT NULL,
211 `augmenter` varchar(20) NOT NULL,
212 `title` varchar(100) default NULL,
213 `otherfield` varchar(20) default NULL,
214 `othervalue` varchar(100) default NULL,
215 `remoteref` varchar(20) default NULL,
216 `matchby` varchar(20) default NULL,
217 UNIQUE KEY `channel_id` (`channel_id`,`augmenter`,`title`,`otherfield`,`othervalue`),
218 CONSTRAINT `augmenterrules_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`)
219 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
221 DROP TABLE IF EXISTS `jobs`;
222 CREATE TABLE `jobs` (
223 `type` varchar(20) NOT NULL,
224 `name` varchar(100) NOT NULL,
225 `starttime` datetime NOT NULL,
226 `deleteafter` datetime NOT NULL,
227 `duration` varchar(20) NOT NULL,
228 `success` tinyint NOT NULL,
229 `message` mediumtext,
230 `lastok` datetime default '0000-00-00 00:00:00',
231 `lastfail` datetime default '0000-00-00 00:00:00',
232 PRIMARY KEY (`type`, `name`)
233 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
235 INSERT INTO `admins` (username, password) VALUES ('nonametv', '');