Compare commits
7
Commits
main
..
10de2ed3de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10de2ed3de | ||
|
|
a787dd96fd | ||
|
|
4c5d8f33d5 | ||
|
|
c515c7cc0a | ||
|
|
325ad8fc5a | ||
|
|
a320e66705 | ||
|
|
d6114a9fa9 |
@@ -2,21 +2,6 @@
|
|||||||
-- which budget (docs/rfc-enakgame.md §5.7, D5). Replaces the unused rewards table for
|
-- which budget (docs/rfc-enakgame.md §5.7, D5). Replaces the unused rewards table for
|
||||||
-- EnakGame; rewards itself stays.
|
-- EnakGame; rewards itself stays.
|
||||||
|
|
||||||
-- Some databases still have the vouchers table of the reverted Voucher Undian feature
|
|
||||||
-- (commit cfe690a). Keep its data under another name; its primary key index is renamed
|
|
||||||
-- too, or vouchers_pkey below would clash.
|
|
||||||
DO $$
|
|
||||||
BEGIN
|
|
||||||
IF EXISTS (
|
|
||||||
SELECT 1 FROM information_schema.columns
|
|
||||||
WHERE table_schema = current_schema() AND table_name = 'vouchers' AND column_name = 'winner_number'
|
|
||||||
) THEN
|
|
||||||
ALTER TABLE vouchers RENAME TO vouchers_undian_legacy;
|
|
||||||
ALTER INDEX IF EXISTS vouchers_pkey RENAME TO vouchers_undian_legacy_pkey;
|
|
||||||
ALTER INDEX IF EXISTS vouchers_voucher_code_key RENAME TO vouchers_undian_legacy_voucher_code_key;
|
|
||||||
END IF;
|
|
||||||
END $$;
|
|
||||||
|
|
||||||
CREATE TABLE vouchers (
|
CREATE TABLE vouchers (
|
||||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
organization_id UUID NOT NULL,
|
organization_id UUID NOT NULL,
|
||||||
|
|||||||
Reference in New Issue
Block a user