]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-1.1.0/test/fixtures/db_definitions/mysql.sql
Patch composite_primary_keys to work around issue when one component of
[rails.git] / vendor / gems / composite_primary_keys-1.1.0 / test / fixtures / db_definitions / mysql.sql
1 create table reference_types (
2     reference_type_id int(11) not null auto_increment,
3     type_label varchar(50) default null,
4     abbreviation varchar(50) default null,
5     description varchar(50) default null,
6     primary key (reference_type_id)
7 ) type=InnoDB;
8
9 create table reference_codes (
10     reference_type_id int(11),
11     reference_code int(11) not null,
12     code_label varchar(50) default null,
13     abbreviation varchar(50) default null,
14     description varchar(50) default null,
15     primary key (reference_type_id, reference_code)
16 ) type=InnoDB;
17
18 create table products (
19     id int(11) not null auto_increment,
20     name varchar(50) default null,
21     primary key (id)
22 ) type=InnoDB;
23
24 create table tariffs (
25     tariff_id int(11) not null,
26     start_date date not null,
27     amount integer(11) default null,
28     primary key (tariff_id, start_date)
29 ) type=InnoDB;
30
31 create table product_tariffs (
32     product_id int(11) not null,
33     tariff_id int(11) not null,
34     tariff_start_date date not null,
35     primary key (product_id, tariff_id, tariff_start_date)
36 ) type=InnoDB;
37
38 create table suburbs (
39     city_id int(11) not null,
40     suburb_id int(11) not null,
41     name varchar(50) not null,
42     primary key (city_id, suburb_id)
43 ) type=InnoDB;
44
45 create table streets (
46     id int(11) not null auto_increment,
47     city_id int(11) not null,
48     suburb_id int(11) not null,
49     name varchar(50) not null,
50     primary key (id)
51 ) type=InnoDB;
52
53 create table users (
54     id int(11) not null auto_increment,
55     name varchar(50) not null,
56     primary key (id)
57 ) type=InnoDB;
58
59 create table articles (
60     id int(11) not null auto_increment,
61     name varchar(50) not null,
62     primary key (id)
63 ) type=InnoDB;
64
65 create table readings (
66     id int(11) not null auto_increment,
67     user_id int(11) not null,
68     article_id int(11) not null,
69     rating int(11) not null,
70     primary key (id)
71 ) type=InnoDB;
72
73 create table groups (
74     id int(11) not null auto_increment,
75     name varchar(50) not null,
76     primary key (id)
77 ) type=InnoDB;
78
79 create table memberships (
80     user_id int(11) not null,
81     group_id int(11) not null,
82     primary key  (user_id,group_id)
83 ) type=InnoDB;
84
85 create table membership_statuses (
86     id int(11) not null auto_increment,
87     user_id int(11) not null,
88     group_id int(11) not null,
89     status varchar(50) not null,
90     primary key (id)
91 ) type=InnoDB;
92
93 create table departments (
94     department_id int(11) not null,
95     location_id int(11) not null,
96     primary key (department_id, location_id)
97 ) type=InnoDB;
98
99 create table employees (
100     id int(11) not null auto_increment,
101     department_id int(11) default null,
102     location_id int(11) default null,
103     primary key (id)
104 ) type=InnoDB;
105
106 create table comments (
107     id int(11) not null auto_increment,
108     person_id varchar(100) default null,
109     person_type varchar(100) default null,
110     hack_id varchar(100) default null,
111     primary key (id)
112 ) type=InnoDB;
113
114 create table hacks (
115     name varchar(50) not null,
116     primary key (name)
117 ) type=InnoDB;
118
119 create table kitchen_sinks (
120     id_1 int(11) not null,
121     id_2 int(11) not null,
122     a_date date,
123     a_string varchar(100),
124     primary key (id_1, id_2)
125 ) type=InnoDB;
126
127 create table restaurants (
128     franchise_id int(11) not null,
129     store_id int(11) not null,
130     name varchar(100),
131     primary key (franchise_id, store_id)
132 ) type=InnoDB;
133
134 create table restaurants_suburbs (
135     franchise_id int(11) not null,
136     store_id int(11) not null,
137     city_id int(11) not null,
138     suburb_id int(11) not null
139 ) type=InnoDB;
140
141 create table dorms (
142     id int(11) not null auto_increment,
143     primary key(id)
144 ) type=InnoDB;
145
146 create table rooms (
147     dorm_id int(11) not null,
148     room_id int(11) not null,
149     primary key (dorm_id, room_id)
150 ) type=InnoDB;
151
152 create table room_attributes (
153     id int(11) not null auto_increment,
154     name varchar(50),
155     primary key(id)
156 ) type=InnoDB;
157
158 create table room_attribute_assignments (
159     dorm_id int(11) not null,
160     room_id int(11) not null,
161     room_attribute_id int(11) not null
162 ) type=InnoDB;
163
164 create table students (
165     id int(11) not null auto_increment,
166     primary key(id)
167 ) type=InnoDB;
168
169 create table room_assignments (
170     student_id int(11) not null,
171     dorm_id int(11) not null,
172     room_id int(11) not null
173 ) type=InnoDB;
174