save "create sync group" table in database
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
DROP TABLE sync_group_listing_drafts;
|
||||
DROP TABLE sync_group_listings;
|
||||
DROP TABLE sync_groups;
|
||||
DROP TYPE platform;
|
||||
@@ -0,0 +1,26 @@
|
||||
CREATE TYPE platform AS ENUM('Etsy', 'Tiktok', 'Wix');
|
||||
|
||||
CREATE TABLE sync_groups (
|
||||
sync_group_id SERIAL PRIMARY KEY,
|
||||
account_id INTEGER NOT NULL REFERENCES accounts
|
||||
);
|
||||
|
||||
CREATE TABLE sync_group_listings (
|
||||
sync_group_id INTEGER NOT NULL REFERENCES sync_groups,
|
||||
order_index INTEGER NOT NULL,
|
||||
platform platform,
|
||||
shop_id TEXT,
|
||||
listing_id TEXT,
|
||||
|
||||
PRIMARY KEY (sync_group_id, order_index)
|
||||
);
|
||||
|
||||
CREATE TABLE sync_group_listing_drafts (
|
||||
account_id INTEGER NOT NULL REFERENCES accounts,
|
||||
order_index INTEGER NOT NULL,
|
||||
platform platform,
|
||||
shop_id TEXT,
|
||||
listing_id TEXT,
|
||||
|
||||
PRIMARY KEY (account_id, order_index)
|
||||
);
|
||||
Reference in New Issue
Block a user