tags and special cakes: models, migrations, store layer
Add Tag, SpecialCake, Cake.Tags, Order.SpecialCakes types. Add migrations for tag, cake_tag, special_cake, special_cake_tag tables. Add store methods: GetTags, GetCakeTags, SaveCakeTags, CreateTag, GetSpecialCakes, GetSpecialCakeTags, SaveSpecialCakes, saveSpecialCakeTags. Load tags in GetCake/GetCakes, cascade tag saves in SaveCake. Remove debug log calls from ParsePrice.
This commit is contained in:
parent
06231cc490
commit
9aafbb94ec
8 changed files with 297 additions and 23 deletions
10
store/migrations/2.sql
Normal file
10
store/migrations/2.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
create table tag (
|
||||
id integer primary key autoincrement,
|
||||
name text not null unique
|
||||
);
|
||||
|
||||
create table cake_tag (
|
||||
cake integer not null references cake(id) on delete cascade,
|
||||
tag integer not null references tag(id) on delete cascade,
|
||||
primary key (cake, tag)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue