add money tracker
All checks were successful
Test and deploy staging / staging (push) Successful in 1m46s
All checks were successful
Test and deploy staging / staging (push) Successful in 1m46s
This commit is contained in:
25
scripts/legacy-schema-migration.sql
Normal file
25
scripts/legacy-schema-migration.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- One-off bridge from the pre-foundation site schema to the current table names.
|
||||
-- Run after the Animaldex UUID conversion, if needed, and before the auth,
|
||||
-- foundation, and catalog migrations. Review and back up each database first.
|
||||
-- Renaming keeps existing rows and foreign keys; lists did not exist in this schema.
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE public.game RENAME TO games;
|
||||
ALTER TABLE public.pokemon_game_entry RENAME TO pokemon_game_entries;
|
||||
ALTER TABLE public.user_entry RENAME TO user_entries;
|
||||
ALTER TABLE public.user_game RENAME TO user_games;
|
||||
|
||||
CREATE TABLE public.lists (
|
||||
id serial PRIMARY KEY,
|
||||
name text NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE public.list_items (
|
||||
id serial PRIMARY KEY,
|
||||
list_id integer NOT NULL REFERENCES public.lists(id) ON DELETE CASCADE,
|
||||
name text NOT NULL
|
||||
);
|
||||
CREATE INDEX list_items_list_id_idx ON public.list_items(list_id);
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user