Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions service/db/psql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ CREATE TABLE IF NOT EXISTS prices (
-- Mark regular_price as required if the table already exists
ALTER TABLE prices ALTER COLUMN regular_price SET NOT NULL;

ALTER TABLE prices DROP CONSTRAINT IF EXISTS prices_pkey;
ALTER TABLE prices DROP CONSTRAINT IF EXISTS prices_chain_product_id_store_id_price_date_key;
ALTER TABLE prices ADD CONSTRAINT prices_pkey PRIMARY KEY (store_id, chain_product_id, price_date);

-- Prices table to store min/max/avg prices per chain
CREATE TABLE IF NOT EXISTS chain_prices (
id SERIAL PRIMARY KEY,
Expand Down
Loading