From f2c03c71cb97e637cd0f6ef6d2be79da035fffd8 Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 22 Nov 2023 16:39:14 +0200 Subject: [PATCH] addTenant.sql script --- dmp-db-scema/updates/00.01.023_addTenant.sql | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dmp-db-scema/updates/00.01.023_addTenant.sql diff --git a/dmp-db-scema/updates/00.01.023_addTenant.sql b/dmp-db-scema/updates/00.01.023_addTenant.sql new file mode 100644 index 000000000..642f8af2b --- /dev/null +++ b/dmp-db-scema/updates/00.01.023_addTenant.sql @@ -0,0 +1,25 @@ +DO $$DECLARE + this_version CONSTANT varchar := '00.01.023'; +BEGIN + PERFORM * FROM "DBVersion" WHERE version = this_version; + IF FOUND THEN RETURN; END IF; + + CREATE TABLE public."Tenant" + ( + id uuid NOT NULL, + name character varying(200) NOT NULL, + code character varying(500) NOT NULL, + description character varying NOT NULL, + config text, + is_active smallint NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + PRIMARY KEY (id) + ) + WITH ( + OIDS = FALSE + ); + + INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.023', '2023-11-20 12:00:00.000000+02', now(), 'Add table Tenant.'); + +END$$; \ No newline at end of file