archive products
This commit is contained in:
12
database/migrations/V7__archive_products.sql
Normal file
12
database/migrations/V7__archive_products.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Add archived flag to products and user_products
|
||||
ALTER TABLE IF EXISTS products
|
||||
ADD COLUMN IF NOT EXISTS archived BOOLEAN DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE IF EXISTS user_products
|
||||
ADD COLUMN IF NOT EXISTS archived BOOLEAN DEFAULT FALSE,
|
||||
ADD COLUMN IF NOT EXISTS updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
|
||||
|
||||
-- Indexes for filtering
|
||||
CREATE INDEX IF NOT EXISTS idx_products_archived ON products (archived);
|
||||
CREATE INDEX IF NOT EXISTS idx_user_products_archived ON user_products (archived);
|
||||
|
||||
Reference in New Issue
Block a user