Drop old unused dataset related tables, small fix to migration script

This commit is contained in:
Thomas Georgios Giannos 2023-10-27 17:29:22 +03:00
parent e31970c7ea
commit 5d882c7e88
2 changed files with 15 additions and 1 deletions

View File

@ -21,7 +21,8 @@ CREATE TABLE IF NOT EXISTS public."Dmp"
"is_active" smallint NOT NULL DEFAULT 1, "is_active" smallint NOT NULL DEFAULT 1,
"finalized_at" timestamp without time zone, "finalized_at" timestamp without time zone,
"published_at" timestamp without time zone, "published_at" timestamp without time zone,
CONSTRAINT "Dmp_pkey" PRIMARY KEY (id) CONSTRAINT "Dmp_pkey" PRIMARY KEY (id),
CONSTRAINT "Dmp_creator_fkey" FOREIGN KEY (creator) REFERENCES public."UserInfo" (id)
) )
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.005', '2023-10-27 12:00:00.000000+02', now(), 'Add Dmp table.'); INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.005', '2023-10-27 12:00:00.000000+02', now(), 'Add Dmp table.');

View File

@ -0,0 +1,13 @@
DO $$DECLARE
this_version CONSTANT varchar := '00.01.009';
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
DROP TABLE public."DatasetProfileViewstyle";
DROP TABLE public."DatasetProfileRuleset";
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.009', '2023-10-27 12:00:00.000000+02', now(), 'Drop old dataset related tables.');
END$$;