Add photos
This commit is contained in:
parent
1e1cd9906d
commit
81e75a4888
18
db/drafts/202204300700_additional_items_and_discounts.sql
Normal file
18
db/drafts/202204300700_additional_items_and_discounts.sql
Normal file
@ -0,0 +1,18 @@
|
||||
CREATE TABLE coupons (
|
||||
id serial not null primary key,
|
||||
"name" varchar not null,
|
||||
"code" varchar not null,
|
||||
"value" int not null default 0
|
||||
);
|
||||
|
||||
create table additional_products (
|
||||
id serial not null primary key,
|
||||
parent_product_id int references products (id) not null,
|
||||
free_product_id int references products (id) not null
|
||||
);
|
||||
|
||||
create table addtional_items (
|
||||
id serial not null primary key,
|
||||
parent_product_id int references products (id) not null,
|
||||
"name" varchar not null
|
||||
);
|
11
db/migrate/202204300704_photos.sql
Normal file
11
db/migrate/202204300704_photos.sql
Normal file
@ -0,0 +1,11 @@
|
||||
CREATE TABLE photos (
|
||||
id serial not null primary key,
|
||||
"local_path" varchar not null unique,
|
||||
"hashed_path" varchar not null unique
|
||||
);
|
||||
|
||||
create table product_photos (
|
||||
id serial not null primary key,
|
||||
product_id int references products (id) not null,
|
||||
photo_id int references photos (id) not null
|
||||
);
|
Loading…
Reference in New Issue
Block a user