diff --git a/schema/pgsql-migrations/upgrade_98.sql b/schema/pgsql-migrations/upgrade_98.sql new file mode 100644 index 00000000..006ae888 --- /dev/null +++ b/schema/pgsql-migrations/upgrade_98.sql @@ -0,0 +1,7 @@ +CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone) RETURNS bigint AS ' + SELECT EXTRACT(EPOCH FROM $1)::bigint AS result +' LANGUAGE sql; + +INSERT INTO director_schema_migration + (schema_version, migration_time) + VALUES (98, NOW()); diff --git a/schema/pgsql.sql b/schema/pgsql.sql index 6bd336fa..fc5df156 100644 --- a/schema/pgsql.sql +++ b/schema/pgsql.sql @@ -49,6 +49,11 @@ CREATE TYPE enum_sync_state AS ENUM( CREATE TYPE enum_host_service AS ENUM('host', 'service'); +CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone) RETURNS bigint AS ' + SELECT EXTRACT(EPOCH FROM $1)::bigint AS result +' LANGUAGE sql; + + CREATE TABLE director_activity_log ( id bigserial, object_type character varying(64) NOT NULL, @@ -1524,4 +1529,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance INSERT INTO director_schema_migration (schema_version, migration_time) - VALUES (97, NOW()); + VALUES (98, NOW());