1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/migrations/sql/007-add-strategies-to-features.down.sql
2016-11-10 15:52:49 +01:00

14 lines
367 B
SQL

--create old columns
ALTER TABLE features ADD "parameters" json;
ALTER TABLE features ADD "strategy_name" varchar(255);
--populate old columns
UPDATE features
SET strategy_name = f.strategies->0->>'name',
parameters = f.strategies->0->'parameters'
FROM features as f
WHERE f.name = features.name;
--drop new column
ALTER TABLE features DROP COLUMN "strategies";