2023-10-20 17:01:09 +02:00
|
|
|
DO $$DECLARE
|
|
|
|
this_version CONSTANT varchar := '00.01.002';
|
|
|
|
BEGIN
|
|
|
|
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
|
|
|
IF FOUND THEN RETURN; END IF;
|
|
|
|
|
2023-10-18 16:58:36 +02:00
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "ID" TO id;
|
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
2023-12-06 17:02:42 +01:00
|
|
|
DROP COLUMN "EntityType";
|
2023-10-18 16:58:36 +02:00
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "RepositoryId" TO repository_id;
|
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "Doi" TO doi;
|
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "CreatedAt" TO created_at;
|
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "UpdatedAt" TO updated_at;
|
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
RENAME "EntityId" TO entity_id;
|
2023-12-06 17:02:42 +01:00
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
|
|
|
ADD COLUMN entity_type smallint NOT NULL DEFAULT 0;
|
2023-10-18 16:58:36 +02:00
|
|
|
|
|
|
|
ALTER TABLE public."EntityDoi"
|
2023-11-22 12:31:00 +01:00
|
|
|
ADD COLUMN is_active smallint NOT NULL DEFAULT 1;
|
2023-10-20 17:01:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.002', '2023-10-19 12:00:00.000000+02', now(), 'Align Entity Doi table.');
|
|
|
|
|
|
|
|
END$$;
|