-
Notifications
You must be signed in to change notification settings - Fork 1
/
get_your_sql_script.sql
56 lines (55 loc) · 7.54 KB
/
get_your_sql_script.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
create table category (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
create table ingredient (id bigint not null auto_increment, amount decimal(19,2), description longtext, recipe_id bigint, uom_id bigint, primary key (id)) engine=InnoDB;
create table note (id bigint not null auto_increment, recipe_note longtext, primary key (id)) engine=InnoDB;
create table recipe (id bigint not null auto_increment, cook_time integer, description longtext, difficulty varchar(255), directions longtext, image longblob, prep_time integer, servings integer, source varchar(255), title varchar(255), url varchar(255), note_id bigint, primary key (id)) engine=InnoDB;
create table recipe_category (recipe_id bigint not null, category_id bigint not null, primary key (recipe_id, category_id)) engine=InnoDB;
create table unit_of_measure (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
alter table ingredient add constraint FKj0s4ywmqqqw4h5iommigh5yja foreign key (recipe_id) references recipe (id);
alter table ingredient add constraint FK6iv5l89qmitedn5m2a71kta2t foreign key (uom_id) references unit_of_measure (id);
alter table recipe add constraint FKlf335hpxlg22j27pg6mk4k9xt foreign key (note_id) references note (id);
alter table recipe_category add constraint FKqsi87i8d4qqdehlv2eiwvpwb foreign key (category_id) references category (id);
alter table recipe_category add constraint FKcqlqnvfyarhieewfeayk3v25v foreign key (recipe_id) references recipe (id);
create table category (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
create table ingredient (id bigint not null auto_increment, amount decimal(19,2), description longtext, recipe_id bigint, uom_id bigint, primary key (id)) engine=InnoDB;
create table note (id bigint not null auto_increment, recipe_note longtext, primary key (id)) engine=InnoDB;
create table recipe (id bigint not null auto_increment, cook_time integer, description longtext, difficulty varchar(255), directions longtext, image longblob, prep_time integer, servings integer, source varchar(255), title varchar(255), url varchar(255), note_id bigint, primary key (id)) engine=InnoDB;
create table recipe_category (recipe_id bigint not null, category_id bigint not null, primary key (recipe_id, category_id)) engine=InnoDB;
create table unit_of_measure (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
alter table ingredient add constraint FKj0s4ywmqqqw4h5iommigh5yja foreign key (recipe_id) references recipe (id);
alter table ingredient add constraint FK6iv5l89qmitedn5m2a71kta2t foreign key (uom_id) references unit_of_measure (id);
alter table recipe add constraint FKlf335hpxlg22j27pg6mk4k9xt foreign key (note_id) references note (id);
alter table recipe_category add constraint FKqsi87i8d4qqdehlv2eiwvpwb foreign key (category_id) references category (id);
alter table recipe_category add constraint FKcqlqnvfyarhieewfeayk3v25v foreign key (recipe_id) references recipe (id);
create table category (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
create table ingredient (id bigint not null auto_increment, amount decimal(19,2), description longtext, recipe_id bigint, uom_id bigint, primary key (id)) engine=InnoDB;
create table note (id bigint not null auto_increment, recipe_note longtext, primary key (id)) engine=InnoDB;
create table recipe (id bigint not null auto_increment, cook_time integer, description longtext, difficulty varchar(255), directions longtext, image longblob, prep_time integer, servings integer, source varchar(255), title varchar(255), url varchar(255), note_id bigint, primary key (id)) engine=InnoDB;
create table recipe_category (recipe_id bigint not null, category_id bigint not null, primary key (recipe_id, category_id)) engine=InnoDB;
create table unit_of_measure (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
alter table ingredient add constraint FKj0s4ywmqqqw4h5iommigh5yja foreign key (recipe_id) references recipe (id);
alter table ingredient add constraint FK6iv5l89qmitedn5m2a71kta2t foreign key (uom_id) references unit_of_measure (id);
alter table recipe add constraint FKlf335hpxlg22j27pg6mk4k9xt foreign key (note_id) references note (id);
alter table recipe_category add constraint FKqsi87i8d4qqdehlv2eiwvpwb foreign key (category_id) references category (id);
alter table recipe_category add constraint FKcqlqnvfyarhieewfeayk3v25v foreign key (recipe_id) references recipe (id);
create table category (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
create table ingredient (id bigint not null auto_increment, amount decimal(19,2), description longtext, recipe_id bigint, uom_id bigint, primary key (id)) engine=InnoDB;
create table note (id bigint not null auto_increment, recipe_note longtext, primary key (id)) engine=InnoDB;
create table recipe (id bigint not null auto_increment, cook_time integer, description longtext, difficulty varchar(255), directions longtext, image longblob, prep_time integer, servings integer, source varchar(255), title varchar(255), url varchar(255), note_id bigint, primary key (id)) engine=InnoDB;
create table recipe_category (recipe_id bigint not null, category_id bigint not null, primary key (recipe_id, category_id)) engine=InnoDB;
create table unit_of_measure (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
alter table ingredient add constraint FKj0s4ywmqqqw4h5iommigh5yja foreign key (recipe_id) references recipe (id);
alter table ingredient add constraint FK6iv5l89qmitedn5m2a71kta2t foreign key (uom_id) references unit_of_measure (id);
alter table recipe add constraint FKlf335hpxlg22j27pg6mk4k9xt foreign key (note_id) references note (id);
alter table recipe_category add constraint FKqsi87i8d4qqdehlv2eiwvpwb foreign key (category_id) references category (id);
alter table recipe_category add constraint FKcqlqnvfyarhieewfeayk3v25v foreign key (recipe_id) references recipe (id);
create table category (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
create table ingredient (id bigint not null auto_increment, amount decimal(19,2), description longtext, recipe_id bigint, uom_id bigint, primary key (id)) engine=InnoDB;
create table note (id bigint not null auto_increment, recipe_note longtext, primary key (id)) engine=InnoDB;
create table recipe (id bigint not null auto_increment, cook_time integer, description longtext, difficulty varchar(255), directions longtext, image longblob, prep_time integer, servings integer, source varchar(255), title varchar(255), url varchar(255), note_id bigint, primary key (id)) engine=InnoDB;
create table recipe_category (recipe_id bigint not null, category_id bigint not null, primary key (recipe_id, category_id)) engine=InnoDB;
create table unit_of_measure (id bigint not null auto_increment, description varchar(255), primary key (id)) engine=InnoDB;
alter table ingredient add constraint FKj0s4ywmqqqw4h5iommigh5yja foreign key (recipe_id) references recipe (id);
alter table ingredient add constraint FK6iv5l89qmitedn5m2a71kta2t foreign key (uom_id) references unit_of_measure (id);
alter table recipe add constraint FKlf335hpxlg22j27pg6mk4k9xt foreign key (note_id) references note (id);
alter table recipe_category add constraint FKqsi87i8d4qqdehlv2eiwvpwb foreign key (category_id) references category (id);
alter table recipe_category add constraint FKcqlqnvfyarhieewfeayk3v25v foreign key (recipe_id) references recipe (id);