diff --git a/etc/schema/pgsql-upgrades/2.11.0.sql b/etc/schema/pgsql-upgrades/2.11.0.sql new file mode 100644 index 000000000..9e57ce78e --- /dev/null +++ b/etc/schema/pgsql-upgrades/2.11.0.sql @@ -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())); diff --git a/etc/schema/pgsql.schema.sql b/etc/schema/pgsql.schema.sql index c1b9fa2ef..8bf4ca07f 100644 --- a/etc/schema/pgsql.schema.sql +++ b/etc/schema/pgsql.schema.sql @@ -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()));