Skip to content

Instantly share code, notes, and snippets.

@sarutobi
Created October 7, 2012 10:28
Show Gist options
  • Save sarutobi/3847796 to your computer and use it in GitHub Desktop.
Save sarutobi/3847796 to your computer and use it in GitHub Desktop.
create table city(
id integer not null auto_increment,
name character varying(50) not null,
primary key (id)
) default character set utf8;
create table request (
id integer not null auto_increment,
code varchar(50) not null,
description varchar(255) not null,
institution integer not null,
primary key(id),
foreign key(institution) references institution(id) on delete restrict
) default character set=utf8;
create table issue(
id integer not null auto_increment,
name varchar(50) not null,
description varchar(255),
primary key (id)
) default character set=utf8;
create table institution (
id integer not null auto_increment,
name varchar(50) not null,
description varchar(255),
primary key(id)
) default character set utf8;
create table documents_meta (
id integer not null auto_increment,
request_date date not null,
replay_date date not null,
filename varchar(255) not null,
request_id integer not null,
primary key(id),
foreign key (request_id) references request(id) on delete restrict
) default character set utf8;
create table req_issue(
id_request integer not null,
id_issue integer not null,
foreign key (id_request) references request(id) on delete restrict,
foreign key (id_issue) references issue(id) on delete restrict
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment