25 lines
805 B
SQL
25 lines
805 B
SQL
DO $$DECLARE
|
|
this_version CONSTANT varchar := '00.01.063';
|
|
BEGIN
|
|
PERFORM * FROM "DBVersion" WHERE version = this_version;
|
|
IF FOUND THEN RETURN; END IF;
|
|
CREATE TABLE public."TenantConfiguration"
|
|
(
|
|
id uuid NOT NULL,
|
|
value character varying NOT NULL,
|
|
type smallint NOT NULL,
|
|
is_active smallint NOT NULL,
|
|
created_at timestamp without time zone NOT NULL,
|
|
updated_at timestamp without time zone NOT NULL,
|
|
tenant uuid,
|
|
PRIMARY KEY (id),
|
|
FOREIGN KEY (tenant)
|
|
REFERENCES public."Tenant" (id) MATCH SIMPLE
|
|
ON UPDATE NO ACTION
|
|
ON DELETE NO ACTION
|
|
NOT VALID
|
|
);
|
|
|
|
INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.01.063', '2024-04-19 12:00:00.000000+02', now(), 'Add TenantConfiguration Table.');
|
|
|
|
END$$; |