argos/dmp-db-scema/updates/00.01.064_Add_ant_Status.sql

26 lines
839 B
MySQL
Raw Permalink Normal View History

2024-06-26 16:31:42 +02:00
DO $$DECLARE
2024-06-27 16:35:43 +02:00
this_version CONSTANT varchar := '00.01.064';
2024-06-26 16:31:42 +02:00
BEGIN
PERFORM * FROM "DBVersion" WHERE version = this_version;
IF FOUND THEN RETURN; END IF;
CREATE TABLE public."ant_Status"
(
id uuid NOT NULL,
label character varying(200) NOT NULL,
internal_status smallint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
is_active smallint NOT NULL,
tenant uuid,
CONSTRAINT "ant_Status_pkey" PRIMARY KEY (id),
CONSTRAINT "ant_Status_tenant_fkey" FOREIGN KEY (tenant)
REFERENCES public."ant_Tenant" (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
);
2024-06-27 16:35:43 +02:00
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.064', '2024-06-26 12:00:00.000000+02', now(), 'Add ant_Status table.');
2024-06-26 16:31:42 +02:00
END$$;