pgsql: Add table `icingaweb_schema`

Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
Johannes Meyer 2022-06-29 15:51:08 +02:00 committed by Eric Lippmann
parent 656f39b9db
commit 9cff754602
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,10 @@
CREATE TABLE "icingaweb_schema" (
"id" serial,
"version" smallint NOT NULL,
"timestamp" int NOT NULL,
CONSTRAINT pk_icingaweb_schema PRIMARY KEY ("id")
);
INSERT INTO icingaweb_schema ("version", "timestamp")
VALUES (6, extract(epoch from now()));

View File

@ -1,4 +1,4 @@
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
/* Icinga Web 2 | (c) 2014 Icinga GmbH | GPLv2+ */
CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone) RETURNS bigint AS '
SELECT EXTRACT(EPOCH FROM $1)::bigint AS result
@ -117,3 +117,14 @@ ALTER TABLE ONLY "icingaweb_rememberme"
PRIMARY KEY (
"id"
);
CREATE TABLE "icingaweb_schema" (
"id" serial,
"version" smallint NOT NULL,
"timestamp" int NOT NULL,
CONSTRAINT pk_icingaweb_schema PRIMARY KEY ("id")
);
INSERT INTO icingaweb_schema (version, timestamp)
VALUES (6, extract(epoch from now()));