database for seed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- Expand allowed values for user_products.custom_product_type to include seed and powder
|
||||
DO $$
|
||||
DECLARE cname text;
|
||||
BEGIN
|
||||
SELECT conname INTO cname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'user_products'::regclass AND contype='c' AND conname LIKE '%custom_product_type%';
|
||||
IF cname IS NOT NULL THEN
|
||||
EXECUTE format('ALTER TABLE user_products DROP CONSTRAINT %I', cname);
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
ALTER TABLE user_products
|
||||
ADD CONSTRAINT user_products_custom_product_type_check CHECK (custom_product_type IN ('granular','liquid','seed','powder'));
|
||||
|
||||
Reference in New Issue
Block a user