pgsql schema: Add function definition for unix_timestamp

This does not seem to require any special privileges since we're using SQL
as language and no unusual data types. If this proves false though, feel
free to fix this.

refs #8826
This commit is contained in:
Johannes Meyer 2015-06-01 15:56:01 +02:00
parent e936c76ca9
commit 80e4e419e2

View File

@ -1,5 +1,9 @@
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
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 "icingaweb_group" (
"id" serial,
"name" character varying(64) NOT NULL,