Add mysql test database

- Fix spacing in postgres test database
This commit is contained in:
Aaron L 2016-09-17 22:09:46 -07:00
parent 1375634f71
commit 02eea7da44
2 changed files with 79 additions and 10 deletions

View file

@ -201,3 +201,71 @@ create table worms (
tiger_id binary null,
foreign key (tiger_id) references tigers (id)
);
create table pilots (
id int primary key not null auto_increment,
name varchar(255)
);
create table airports (
id int primary key not null auto_increment,
name varchar(255)
);
create table languages (
id int primary key not null auto_increment,
name varchar(255)
);
create table jets (
id int primary key not null auto_increment,
name varchar(255),
pilot_id integer,
airport_id integer,
foreign key (pilot_id) references pilots (id),
foreign key (airport_id) references airports (id)
);
create table pilot_languages (
pilot_id integer not null,
language_id integer not null,
primary key (pilot_id, language_id),
foreign key (pilot_id) references pilots (id),
foreign key (language_id) references languages (id)
);
create table byte_pilots (
id binary primary key not null,
name varchar(255)
);
create table byte_airports (
id binary primary key not null,
name varchar(255)
);
create table byte_languages (
id binary primary key not null,
name varchar(255)
);
create table byte_jets (
id binary primary key not null,
name varchar(255),
byte_pilot_id binary unique,
byte_airport_id binary,
foreign key (byte_pilot_id) references byte_pilots (id),
foreign key (byte_airport_id) references byte_airports (id)
);
create table byte_pilot_languages (
byte_pilot_id binary not null,
byte_language_id binary not null,
primary key (byte_pilot_id, byte_language_id),
foreign key (byte_pilot_id) references byte_pilots (id),
foreign key (byte_language_id) references byte_languages (id)
);

View file

@ -253,19 +253,19 @@ create table pilots (
);
create table airports (
id serial primary key not null,
id serial primary key not null,
name character varying
);
create table languages (
id serial primary key not null,
id serial primary key not null,
name character varying
);
create table jets (
id serial primary key not null,
name character varying,
pilot_id integer,
id serial primary key not null,
name character varying,
pilot_id integer,
airport_id integer,
foreign key (pilot_id) references pilots (id),
foreign key (airport_id) references airports (id)
@ -286,20 +286,21 @@ create table byte_pilots (
);
create table byte_airports (
id bytea primary key not null,
id bytea primary key not null,
name character varying
);
create table byte_languages (
id bytea primary key not null,
id bytea primary key not null,
name character varying
);
create table byte_jets (
id bytea primary key not null,
name character varying,
byte_pilot_id bytea unique,
id bytea primary key not null,
name character varying,
byte_pilot_id bytea unique,
byte_airport_id bytea,
foreign key (byte_pilot_id) references byte_pilots (id),
foreign key (byte_airport_id) references byte_airports (id)
);