-
Notifications
You must be signed in to change notification settings - Fork 9
/
init.sql
35 lines (28 loc) · 1.08 KB
/
init.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
CREATE DATABASE `modelgen_tests`;
USE `modelgen_tests`;
-- order is a builtin, tests should pass despite this
DROP TABLE IF EXISTS `order`;
-- only one field should not break despite the special cases.
CREATE TABLE `order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `common_cases`;
CREATE TABLE `common_cases` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`not_null_string` varchar(255) NOT NULL DEFAULT '',
`not_null_int` int(11) NOT NULL,
`null_string` int(11) DEFAULT NULL,
`null_int` int(11) DEFAULT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `complex_cases`;
CREATE TABLE `complex_cases` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`raw_json` json NOT NULL,
`size_enum` enum('X-SMALL','SMALL','MEDIUM','LARGE','X-LARGE') DEFAULT NULL,
`updated_at` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;