Only output trigger 'scope' if it's set in YAML and JSON producers
[dbsrgits/SQL-Translator.git] / t / data / mysql / cashmusic_db.sql
CommitLineData
d0a4031c 1SET FOREIGN_KEY_CHECKS = 0;
2
3DROP TABLE IF EXISTS `asst_assets`;
4
5CREATE TABLE `asst_assets` (
6 `id` int(11) NOT NULL AUTO_INCREMENT,
7 `user_id` int(11) DEFAULT NULL,
8 `parent_id` int(11) DEFAULT NULL,
9 `location` text,
10 `settings_id` int(11) DEFAULT NULL,
11 `title` text,
12 `description` text,
13 `public_status` bit(1) DEFAULT b'0',
14 `creation_date` int(11) DEFAULT NULL,
15 `modification_date` int(11) DEFAULT '0',
16 PRIMARY KEY (`id`),
17 KEY `asst_asets_parent_id` (`parent_id`),
18 KEY `asst_assets_user_id` (`user_id`)
19) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
21
22DROP TABLE IF EXISTS `asst_licenses`;
23
24CREATE TABLE `asst_licenses` (
25 `id` int(11) NOT NULL AUTO_INCREMENT,
26 `name` text NOT NULL,
27 `description` text NOT NULL,
28 `fulltext` blob NOT NULL,
29 `uri` text NOT NULL,
30 PRIMARY KEY (`id`)
31) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32
33
34DROP TABLE IF EXISTS `cmrc_products`;
35
36CREATE TABLE `cmrc_products` (
37 `id` int(11) NOT NULL AUTO_INCREMENT,
38 `sku` varchar(20) DEFAULT NULL,
39 `title` varchar(100) DEFAULT NULL,
40 `price` decimal(9,2) DEFAULT NULL,
41 `type` varchar(100) DEFAULT NULL,
42 `beneficiary` varchar(50) DEFAULT NULL,
43 `sub_term_seconds` int(11) DEFAULT NULL,
44 `qty_total` int(11) NOT NULL DEFAULT '0',
45 `creation_date` int(11) NOT NULL DEFAULT '0',
46 `modification_date` int(11) DEFAULT NULL,
47 PRIMARY KEY (`id`)
48) ENGINE=InnoDB DEFAULT CHARSET=utf8;
49
50
51DROP TABLE IF EXISTS `cmrc_transactions`;
52
53CREATE TABLE `cmrc_transactions` (
54 `id` int(11) NOT NULL AUTO_INCREMENT,
55 `order_timestamp` varchar(24) NOT NULL DEFAULT '',
56 `payer_email` varchar(75) NOT NULL DEFAULT '',
57 `payer_id` varchar(60) NOT NULL DEFAULT '',
58 `payer_firstname` varchar(127) NOT NULL DEFAULT '',
59 `payer_lastname` varchar(127) NOT NULL DEFAULT '',
60 `country` varchar(8) NOT NULL DEFAULT '',
61 `product_sku` varchar(48) NOT NULL DEFAULT '',
62 `product_name` varchar(255) NOT NULL DEFAULT '',
63 `transaction_id` varchar(24) NOT NULL DEFAULT '',
64 `transaction_status` varchar(32) NOT NULL DEFAULT '',
65 `transaction_currency` varchar(8) NOT NULL DEFAULT '',
66 `transaction_amount` int(11) NOT NULL DEFAULT '0',
67 `transaction_fee` decimal(9,2) NOT NULL DEFAULT '0.00',
68 `is_fulfilled` smallint(1) NOT NULL DEFAULT '0',
69 `referral_code` varchar(191) DEFAULT NULL,
70 `nvp_request_json` text,
71 `nvp_response_json` text,
72 `nvp_details_json` text,
73 `creation_date` int(11) NOT NULL DEFAULT '0',
74 `modification_date` int(11) DEFAULT '0',
75 PRIMARY KEY (`id`)
76) ENGINE=InnoDB DEFAULT CHARSET=utf8;
77
78
79DROP TABLE IF EXISTS `live_events`;
80
81CREATE TABLE `live_events` (
82 `id` int(11) NOT NULL AUTO_INCREMENT,
83 `date` int(11) DEFAULT NULL,
84 `user_id` int(11) DEFAULT NULL,
85 `venue_id` int(11) DEFAULT NULL,
86 `publish` tinyint(1) DEFAULT NULL,
87 `cancelled` tinyint(1) DEFAULT NULL,
88 `comments` text,
89 `creation_date` int(11) DEFAULT NULL,
90 `modification_date` int(11) DEFAULT NULL,
91 PRIMARY KEY (`id`),
92 KEY `live_events_user_id` (`user_id`)
93) ENGINE=InnoDB DEFAULT CHARSET=utf8;
94
95
96DROP TABLE IF EXISTS `live_venues`;
97
98CREATE TABLE `live_venues` (
99 `id` int(11) NOT NULL AUTO_INCREMENT,
100 `name` text NOT NULL,
101 `address1` text,
102 `address2` text,
103 `city` text,
104 `region` text,
105 `country` text,
106 `postalcode` text,
107 `latitude` float DEFAULT NULL,
108 `longitude` float DEFAULT NULL,
109 `website` text,
110 `phone` text,
111 `creation_date` int(11) DEFAULT NULL,
112 `modification_date` int(11) DEFAULT NULL,
113 PRIMARY KEY (`id`)
114) ENGINE=InnoDB DEFAULT CHARSET=utf8;
115
116
117DROP TABLE IF EXISTS `lock_codes`;
118
119CREATE TABLE `lock_codes` (
120 `id` int(11) NOT NULL AUTO_INCREMENT,
121 `uid` tinytext,
122 `element_id` int(11) DEFAULT NULL,
123 `claim_date` int(11) DEFAULT NULL,
124 `creation_date` int(11) DEFAULT '0',
125 `modification_date` int(11) DEFAULT NULL,
126 PRIMARY KEY (`id`),
127 KEY `lock_codes_element_id` (`element_id`)
128) ENGINE=InnoDB DEFAULT CHARSET=utf8;
129
130
131DROP TABLE IF EXISTS `lock_passwords`;
132
133CREATE TABLE `lock_passwords` (
134 `id` int(11) NOT NULL AUTO_INCREMENT,
135 `password` text,
136 `element_id` int(11) DEFAULT NULL,
137 `creation_date` int(11) DEFAULT '0',
138 `modification_date` int(11) DEFAULT NULL,
139 PRIMARY KEY (`id`),
140 KEY `lock_passwords_element_id` (`element_id`)
141) ENGINE=InnoDB DEFAULT CHARSET=utf8;
142
143
144DROP TABLE IF EXISTS `asst_analytics`;
145
146CREATE TABLE `asst_analytics` (
147 `id` int(11) NOT NULL AUTO_INCREMENT,
148 `asset_id` int(11) NOT NULL DEFAULT '0',
149 `element_id` int(11) DEFAULT NULL,
150 `access_time` int(11) NOT NULL,
151 `client_ip` varchar(39) NOT NULL,
152 `client_proxy` varchar(39) NOT NULL,
153 `cash_session_id` varchar(24) NOT NULL,
154 `creation_date` int(11) DEFAULT NULL,
155 `modification_date` int(11) DEFAULT '0',
156 PRIMARY KEY (`id`),
157 KEY `asst_analytics_asset_id` (`id`)
158) ENGINE=InnoDB DEFAULT CHARSET=utf8;
159
160
161DROP TABLE IF EXISTS `lock_permissions`;
162
163CREATE TABLE `lock_permissions` (
164 `id` int(11) NOT NULL AUTO_INCREMENT,
165 `user_id` int(11) NOT NULL,
166 `user_list_id` int(11) NOT NULL DEFAULT '0',
167 `element_id` int(11) NOT NULL DEFAULT '0',
168 `allowed_logins` int(11) NOT NULL DEFAULT '-1',
169 `total_logins` int(11) NOT NULL DEFAULT '0',
170 `date_expires` int(11) NOT NULL DEFAULT '-1',
171 `element_password` tinytext,
172 `added_by` int(11) NOT NULL DEFAULT '0',
173 `creation_date` int(11) DEFAULT NULL,
174 `modification_date` int(11) DEFAULT NULL,
175 PRIMARY KEY (`id`),
176 KEY `lock_permissions_login_id` (`user_list_id`,`element_id`),
177 KEY `lock_permissions_element_id` (`element_id`)
178) ENGINE=InnoDB DEFAULT CHARSET=utf8;
179
180
181DROP TABLE IF EXISTS `user_users`;
182
183CREATE TABLE `user_users` (
184 `id` int(11) NOT NULL AUTO_INCREMENT,
185 `email_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
186 `password` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
187 `username` varchar(32) NOT NULL DEFAULT '',
188 `display_name` tinytext,
189 `first_name` tinytext,
190 `last_name` tinytext,
191 `organization` tinytext,
192 `address_line1` tinytext,
193 `address_line2` tinytext,
194 `address_city` tinytext,
195 `address_region` tinytext,
196 `address_postalcode` tinytext,
197 `address_country` tinytext,
198 `is_admin` bit(1) NOT NULL DEFAULT b'0',
199 `creation_date` int(11) DEFAULT NULL,
200 `modification_date` int(11) DEFAULT NULL,
201 PRIMARY KEY (`id`),
202 KEY `email` (`email_address`)
203) ENGINE=InnoDB DEFAULT CHARSET=utf8;
204
205
206DROP TABLE IF EXISTS `user_lists`;
207
208CREATE TABLE `user_lists` (
209 `id` int(11) NOT NULL AUTO_INCREMENT,
210 `name` varchar(128) NOT NULL DEFAULT '',
211 `description` text,
212 `user_id` int(11) NOT NULL,
213 `settings_id` int(11) NOT NULL,
214 `creation_date` int(11) DEFAULT NULL,
215 `modification_date` int(11) DEFAULT '0',
216 PRIMARY KEY (`id`)
217) ENGINE=InnoDB DEFAULT CHARSET=utf8;
218
219
220DROP TABLE IF EXISTS `user_resetpassword`;
221
222CREATE TABLE `user_resetpassword` (
223 `id` int(11) NOT NULL AUTO_INCREMENT,
224 `time_requested` int(11) NOT NULL DEFAULT '0',
225 `random_key` tinytext NOT NULL,
226 `user_id` int(11) NOT NULL DEFAULT '0',
227 `creation_date` int(11) DEFAULT NULL,
228 `modification_date` int(11) DEFAULT NULL,
229 PRIMARY KEY (`id`)
230) ENGINE=InnoDB DEFAULT CHARSET=utf8;
231
232
233DROP TABLE IF EXISTS `elmt_elements`;
234
235CREATE TABLE `elmt_elements` (
236 `id` int(11) NOT NULL AUTO_INCREMENT,
237 `user_id` int(11) DEFAULT NULL,
238 `name` text,
239 `type` text NOT NULL,
240 `options` text,
241 `license_id` int(11) DEFAULT '0',
242 `creation_date` int(11) DEFAULT NULL,
243 `modification_date` int(11) DEFAULT NULL,
244 PRIMARY KEY (`id`)
245) ENGINE=InnoDB DEFAULT CHARSET=utf8;
246
247
248DROP TABLE IF EXISTS `elmt_analytics`;
249
250CREATE TABLE `elmt_analytics` (
251 `id` int(11) NOT NULL AUTO_INCREMENT,
252 `element_id` int(11) NOT NULL,
253 `access_method` varchar(24) NOT NULL,
254 `access_location` text NOT NULL,
255 `lock_method_table` varchar(24) NOT NULL,
256 `lock_method_id` int(11) NOT NULL,
257 `access_time` int(11) NOT NULL,
258 `client_ip` varchar(39) NOT NULL,
259 `client_proxy` varchar(39) NOT NULL,
260 `cash_session_id` varchar(24) NOT NULL,
261 `creation_date` int(11) DEFAULT NULL,
262 `modification_date` int(11) DEFAULT '0',
263 PRIMARY KEY (`id`),
264 KEY `elmt_analytics_element_id` (`element_id`)
265) ENGINE=InnoDB DEFAULT CHARSET=utf8;
266
267
268DROP TABLE IF EXISTS `base_settings`;
269
270CREATE TABLE `base_settings` (
271 `id` int(11) NOT NULL AUTO_INCREMENT,
272 `name` text,
273 `type` text NOT NULL,
274 `data` text NOT NULL,
275 `user_id` int(11) NOT NULL,
276 `creation_date` int(11) DEFAULT NULL,
277 `modification_date` int(11) DEFAULT NULL,
278 PRIMARY KEY (`id`)
279) ENGINE=InnoDB DEFAULT CHARSET=utf8;
280
281
282DROP TABLE IF EXISTS `user_lists_members`;
283
284CREATE TABLE `user_lists_members` (
285 `id` int(11) NOT NULL AUTO_INCREMENT,
286 `user_id` int(11) NOT NULL,
287 `list_id` int(11) NOT NULL,
288 `verification_code` text NOT NULL,
289 `verified` bit(1) NOT NULL,
290 `initial_comment` text NOT NULL,
291 `additional_data` text NOT NULL,
292 `creation_date` int(11) DEFAULT NULL,
293 `modification_date` int(11) DEFAULT '0',
294 PRIMARY KEY (`id`),
295 KEY `user_lists_members_user_id` (`user_id`),
296 KEY `user_lists_members_list_id` (`list_id`)
297) ENGINE=InnoDB DEFAULT CHARSET=utf8;
298
299
300DROP TABLE IF EXISTS `live_guestlist`;
301
302CREATE TABLE `live_guestlist` (
303 `id` int(11) NOT NULL AUTO_INCREMENT,
304 `event_id` int(128) NOT NULL,
305 `guest_name` text,
306 `total_attendees` int(11) NOT NULL DEFAULT '1',
307 `comment` text NOT NULL,
308 `creation_date` int(11) DEFAULT NULL,
309 `modification_date` int(11) DEFAULT '0',
310 PRIMARY KEY (`id`)
311) ENGINE=InnoDB DEFAULT CHARSET=utf8;
312
313
314DROP TABLE IF EXISTS `base_metadata`;
315
316CREATE TABLE `base_metadata` (
317 `id` int(11) NOT NULL AUTO_INCREMENT,
318 `scope_table_alias` varchar(64) NOT NULL DEFAULT '',
319 `scope_table_id` int(11) NOT NULL DEFAULT '0',
320 `user_id` int(11) NOT NULL DEFAULT '0',
321 `type` text,
322 `value` text NOT NULL,
323 `creation_date` int(11) DEFAULT NULL,
324 `modification_date` int(11) DEFAULT NULL,
325 PRIMARY KEY (`id`),
326 KEY `base_metadata_scope_table` (`scope_table_alias`,`scope_table_id`)
327) ENGINE=InnoDB DEFAULT CHARSET=utf8;
328
329
330SET FOREIGN_KEY_CHECKS = 1;