Closed opino closed 10 months ago
SELECT EXISTS ( SELECT 1 FROM pg_language WHERE lanname = 'plpgsql');
» )Sorry for the late reply, suddenly it was chrismas, and then I was one week ill.
Does your Redmine work well under Postgres without the plugin?
Yes, as long as the plugin is not activated in the configuration, Redmine works. When I create a new ticket with the plugin enabled, I get an internal error.
What is your version of Postgres?
root@a6d0d3e3c9bc:/# psql -U postgres
psql (16.1 (Debian 16.1-1.pgdg120+1))
Type "help" for help.
postgres=# SELECT EXISTS ( SELECT 1 FROM pg_language WHERE lanname = 'plpgsql');
exists
--------
t
(1 row)
postgres=# \q
root@a6d0d3e3c9bc:/# postgres -V
postgres (PostgreSQL) 16.1 (Debian 16.1-1.pgdg120+1)
-- Dumped from database version 16.1 (Debian 16.1-1.pgdg120+1) -- Dumped by pg_dump version 16.1 (Debian 16.1-1.pgdg120+1)
SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off;
CREATE SCHEMA redmine;
ALTER SCHEMA redmine OWNER TO postgres;
CREATE TYPE public.sla_log_level AS ENUM ( 'log_none', 'log_error', 'log_info', 'log_debug' );
ALTER TYPE public.sla_log_level OWNER TO postgres;
CREATE FUNCTION redmine.sla_get_date(p_date timestamp without time zone) RETURNS timestamp without time zone LANGUAGE sql AS $$ -- SET SESSION timezone TO 'Etc/UTC'; SELECT DATE_TRUNC( 'MINUTE', TIMEZONE( ( SELECT COALESCE( ( SELECT SUBSTRING( value FROM 'sla_time_zone: ([a-z,A-Z,/]*)') FROM settings WHERE name LIKE 'plugin_redmine_sla' ), 'Etc/UTC' ) ), p_date AT TIME ZONE 'Etc/UTC' ) ) ;$$;
ALTER FUNCTION redmine.sla_get_date(p_date timestamp without time zone) OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
CREATE TABLE public.sla_caches ( id bigint NOT NULL, issue_id bigint NOT NULL, sla_level_id bigint NOT NULL, start_date timestamp without time zone NOT NULL );
ALTER TABLE public.sla_caches OWNER TO postgres;
CREATE FUNCTION redmine.sla_get_level(p_issue_id integer) RETURNS public.sla_caches LANGUAGE plpgsql AS $$ DECLARE v_issue_project_id INTEGER ; DECLARE v_issue_tracker_id INTEGER ; DECLARE v_issue_created_on TIMESTAMP WITHOUT TIME ZONE ; DECLARE v_sla_cache sla_caches ; BEGIN
RAISE DEBUG 'sla_get_level BEGIN ---' ;
-- SET SESSION timezone TO 'Etc/UTC';
-- We avoid looking for a missing issue IF ( p_issue_id IS NULL ) THEN RETURN NULL ; END IF ;
-- We get the information already in the cache (if it is there, then it is good) SELECT "sla_caches"."id" AS "id", "sla_caches"."issue_id" AS "issue_id", "sla_caches"."sla_level_id" AS "sla_level_id", "sla_caches"."start_date" AS "start_date" INTO v_sla_cache FROM "sla_caches" WHERE "sla_caches"."issue_id" = p_issue_id ;
-- If the information is there. IF ( v_sla_cache IS NOT NULL ) THEN -- So we can return it. RETURN v_sla_cache ; END IF ;
-- So we take the information we need ( project, tracker, created date and time)
SELECT sla_get_date( "issues"."created_on" ), tracker_id, project_id INTO v_issue_created_on, v_issue_tracker_id, v_issue_project_id FROM issues WHERE id = p_issue_id ;
RAISE DEBUG 'sla_get_level v_issue_created_on = %', v_issue_created_on ;
-- So we can find the expected level according to the project, tracker, created date and time
SELECT DISTINCT
-- Preparing the record for the cache, ID will be determined on insert in the cache
NULL::integer AS "id",
"p_issue_id" AS "issue_id",
"sla_levels"."id" AS "sla_level_id",
"calendrier"."minutes" AS "start_date"
INTO
v_sla_cache
FROM
( SELECT generate_series( v_issue_created_on, v_issue_created_on + INTERVAL '7 days', '1 minute') AS minutes ) AS "calendrier"
INNER JOIN
"sla_schedules"
ON ( DATE_PART('dow',"calendrier"."minutes") = "sla_schedules"."dow" AND "calendrier"."minutes"::TIME BETWEEN "sla_schedules"."start_time" AND "sla_schedules"."end_time" )
INNER JOIN
"sla_calendars"
ON ( "sla_calendars"."id" = "sla_schedules"."sla_calendar_id" )
INNER JOIN
"sla_levels"
ON ( "sla_levels"."sla_calendar_id" = "sla_calendars"."id" )
INNER JOIN
"sla_project_trackers"
ON ( "sla_project_trackers"."sla_id" = "sla_levels"."sla_id" )
LEFT JOIN
(
SELECT "date", "sla_calendar_id"
FROM "sla_calendar_holidays"
INNER JOIN "sla_holidays"
ON ( "sla_holidays"."id" = "sla_calendar_holidays"."sla_holiday_id" AND "sla_calendar_holidays"."match" )
) AS "sla_holiday_match"
ON ( "sla_holiday_match"."sla_calendar_id" = "sla_schedules"."sla_calendar_id" AND "sla_holiday_match"."date" = "calendrier"."minutes"::DATE )
WHERE
"sla_project_trackers"."project_id" = v_issue_project_id
AND
"sla_project_trackers"."tracker_id" = v_issue_tracker_id
AND
"calendrier"."minutes"::DATE NOT IN (
SELECT "sla_holidays"."date"
FROM "sla_holidays"
INNER JOIN "sla_calendar_holidays"
ON ( "sla_holidays"."id" = "sla_calendar_holidays"."sla_holiday_id" )
WHERE "sla_calendar_holidays"."sla_calendar_id" = "sla_calendars"."id"
AND NOT "sla_calendar_holidays"."match"
)
AND
( "sla_schedules"."match" OR "sla_holiday_match"."date" = "calendrier"."minutes"::DATE )
ORDER BY
"calendrier"."minutes"
LIMIT 1 ;
-- We didn't find anything ! IF ( v_sla_cache IS NULL ) THEN RETURN NULL ; END IF ;
-- Insert the data in the level cache INSERT INTO "sla_caches" ( "issue_id", "sla_level_id", "start_date" ) VALUES ( v_sla_cache."issue_id", v_sla_cache."sla_level_id", v_sla_cache."start_date" ) RETURNING id INTO v_sla_cache."id" ;
RAISE DEBUG 'sla_get_level END ------' ;
RETURN v_sla_cache ;
END; $$;
ALTER FUNCTION redmine.sla_get_level(p_issue_id integer) OWNER TO postgres;
CREATE TABLE public.sla_cache_spents ( sla_cache_id bigint NOT NULL, sla_type_id bigint NOT NULL, updated_on timestamp without time zone NOT NULL, spent integer NOT NULL );
ALTER TABLE public.sla_cache_spents OWNER TO postgres;
CREATE FUNCTION redmine.sla_get_spent(p_issue_id integer, p_sla_type_id integer) RETURNS public.sla_cache_spents LANGUAGE plpgsql AS $$ DECLARE v_issue_project_id INTEGER ; DECLARE v_issue_tracker_id INTEGER ; DECLARE v_issue_created_on TIMESTAMP WITHOUT TIME ZONE ; DECLARE v_issue_closed_on TIMESTAMP WITHOUT TIME ZONE ; DECLARE v_current_timestamp TIMESTAMP WITHOUT TIME ZONE ; DECLARE v_sla_cache sla_caches ; DECLARE v_sla_spent sla_cache_spents ; BEGIN
RAISE DEBUG 'sla_get_spent BEGIN ---' ;
-- SET SESSION timezone TO 'Etc/UTC';
-- We avoid looking for a missing issue or sla type IF ( ( p_issue_id IS NULL ) OR ( p_sla_type_id IS NULL ) ) THEN RETURN NULL ; END IF ;
-- We get the date and time from now v_current_timestamp := sla_get_date(NOW()::TIMESTAMP WITHOUT TIME ZONE);
RAISE DEBUG 'sla_get_spent v_current_timestamp = %', v_current_timestamp ;
v_sla_cache := sla_get_level( p_issue_id ) ;
IF ( v_sla_cache IS NULL ) THEN RETURN NULL ; END IF ;
SELECT
"sla_cache_spents"."sla_cache_id" AS "sla_cache_id",
"sla_cache_spents"."sla_type_id" AS "sla_type_id",
"sla_cache_spents"."updated_on" AS "updated_on",
"sla_cache_spents"."spent" AS "spent"
INTO
v_sla_spent
FROM
"sla_cache_spents"
WHERE
"sla_cache_spents"."sla_cache_id" = v_sla_cache.id
AND "sla_cache_spents"."sla_type_id" = p_sla_type_id ;
-- TheIf the time spent has just been calculated,
IF ( ( v_sla_spent IS NOT NULL ) AND ( v_sla_spent."updated_on" IS NOT NULL ) AND ( v_sla_spent."updated_on" = "v_current_timestamp" ) ) THEN -- then no need to redo the calculation RETURN v_sla_spent ; END IF ;
-- Retrieve issue data
SELECT -- DATE_TRUNC('MINUTE', COALESCE( v_sla_spent."updated_on", v_sla_cache."start_date" ) ), COALESCE( v_sla_spent."updated_on", v_sla_cache."start_date" ), -- DATE_TRUNC('MINUTE', COALESCE( "issues"."closed_on", v_current_timestamp ) ), COALESCE( sla_get_date("issues"."closed_on"), v_current_timestamp ), tracker_id, project_id INTO v_issue_created_on, v_issue_closed_on, v_issue_tracker_id, v_issue_project_id FROM issues WHERE id = p_issue_id ;
-- No update needed, if done after closing date IF ( v_sla_spent."updated_on" > v_issue_closed_on ) THEN UPDATE "sla_cache_spents" SET "updated_on" = v_current_timestamp WHERE "sla_cache_spents"."sla_cache_id" = v_sla_spent."sla_cache_id" AND "sla_cache_spents"."sla_type_id" = v_sla_spent."sla_type_id" ; RETURN v_sla_spent ; END IF ;
-- Calculate since it wasn't done
SELECT DISTINCT
COALESCE( v_sla_spent."sla_cache_id", v_sla_cache."id" ) AS "sla_cache_id",
p_sla_type_id AS "sla_type_id",
v_current_timestamp AS "updated_on",
COUNT(*) AS "spent"
INTO
v_sla_spent
FROM
"issues"
INNER JOIN
"sla_view_roll_statuses" ON ( "issues"."id" = "sla_view_roll_statuses"."issue_id" )
INNER JOIN
( SELECT generate_series ( v_issue_created_on, v_issue_closed_on, '1 minute' ) AS minutes ) AS "calendrier"
ON ( "calendrier"."minutes" BETWEEN "sla_view_roll_statuses"."from_status_date" AND "sla_view_roll_statuses"."to_status_date" - INTERVAL '1 minute' )
INNER JOIN
"sla_schedules"
ON ( DATE_PART('dow',calendrier.minutes) = "sla_schedules"."dow" AND "calendrier"."minutes"::TIME BETWEEN "sla_schedules"."start_time" AND "sla_schedules"."end_time" )
INNER JOIN
"sla_calendars"
ON ( "sla_calendars"."id" = "sla_schedules"."sla_calendar_id" )
INNER JOIN
"sla_levels"
ON ( "sla_levels"."sla_calendar_id" = "sla_calendars"."id" AND "sla_levels"."id" = v_sla_cache.sla_level_id )
INNER JOIN
"sla_project_trackers"
ON ( "sla_project_trackers"."sla_id" = "sla_levels"."sla_id" )
WHERE
"issues"."id" = p_issue_id
AND
"sla_view_roll_statuses"."from_status_id" IN ( SELECT DISTINCT "sla_statuses"."status_id" FROM "sla_statuses" WHERE "sla_statuses"."sla_type_id" = p_sla_type_id )
AND
"sla_project_trackers"."project_id" = "issues"."project_id"
AND
"sla_project_trackers"."tracker_id" = "issues"."tracker_id"
AND
-- Subtract the holidays
DATE_TRUNC('day',"calendrier"."minutes") NOT IN (
SELECT "sla_holidays"."date"
FROM "sla_holidays"
INNER JOIN "sla_calendar_holidays"
ON ( "sla_calendar_holidays"."sla_holiday_id" = "sla_holidays"."id" )
WHERE "sla_calendar_holidays"."sla_calendar_id" = "sla_calendars"."id"
AND NOT "sla_calendar_holidays"."match"
)
;
IF ( v_sla_spent."spent" < 0 ) THEN
v_sla_spent."spent" := 0 ;
END IF ;
-- Insert the data in the spent cache
INSERT INTO sla_cache_spents (
"sla_cache_id",
"sla_type_id",
"updated_on",
"spent"
) VALUES ( v_sla_spent."sla_cache_id", v_sla_spent."sla_type_id", v_sla_spent."updated_on", v_sla_spent."spent" ) -- if data already exists, then do an update ON CONFLICT ON CONSTRAINT sla_cache_spents_pkey DO UPDATE SET "updated_on" = v_sla_spent."updated_on", "spent" = "sla_cache_spents"."spent" + v_sla_spent."spent" ;
RAISE DEBUG 'sla_get_spent END ------' ;
RETURN v_sla_spent ;
END; $$;
ALTER FUNCTION redmine.sla_get_spent(p_issue_id integer, p_sla_type_id integer) OWNER TO postgres;
CREATE SEQUENCE public.sla_caches_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_caches_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_caches_id_seq OWNED BY public.sla_caches.id;
CREATE TABLE public.sla_calendar_holidays ( id bigint NOT NULL, sla_calendar_id bigint, sla_holiday_id bigint, match boolean DEFAULT false NOT NULL );
ALTER TABLE public.sla_calendar_holidays OWNER TO postgres;
CREATE SEQUENCE public.sla_calendar_holidays_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_calendar_holidays_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_calendar_holidays_id_seq OWNED BY public.sla_calendar_holidays.id;
CREATE TABLE public.sla_calendars ( id bigint NOT NULL, name text NOT NULL );
ALTER TABLE public.sla_calendars OWNER TO postgres;
CREATE SEQUENCE public.sla_calendars_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_calendars_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_calendars_id_seq OWNED BY public.sla_calendars.id;
CREATE TABLE public.sla_holidays ( id bigint NOT NULL, date date NOT NULL, name text NOT NULL );
ALTER TABLE public.sla_holidays OWNER TO postgres;
CREATE SEQUENCE public.sla_holidays_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_holidays_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_holidays_id_seq OWNED BY public.sla_holidays.id;
CREATE TABLE public.sla_level_terms ( id bigint NOT NULL, sla_level_id bigint NOT NULL, sla_type_id bigint NOT NULL, priority_id integer NOT NULL, term integer NOT NULL );
ALTER TABLE public.sla_level_terms OWNER TO postgres;
CREATE SEQUENCE public.sla_level_terms_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_level_terms_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_level_terms_id_seq OWNED BY public.sla_level_terms.id;
CREATE TABLE public.sla_levels ( id bigint NOT NULL, name text NOT NULL, sla_id bigint, sla_calendar_id bigint );
ALTER TABLE public.sla_levels OWNER TO postgres;
CREATE SEQUENCE public.sla_levels_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_levels_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_levels_id_seq OWNED BY public.sla_levels.id;
CREATE TABLE public.sla_logs ( id bigint NOT NULL, project_id bigint, issue_id bigint, sla_level_id bigint, log_level public.sla_log_level, description text );
ALTER TABLE public.sla_logs OWNER TO postgres;
CREATE SEQUENCE public.sla_logs_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_logs_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_logs_id_seq OWNED BY public.sla_logs.id;
CREATE TABLE public.sla_project_trackers ( id bigint NOT NULL, project_id bigint, tracker_id bigint, sla_id bigint );
ALTER TABLE public.sla_project_trackers OWNER TO postgres;
CREATE SEQUENCE public.sla_project_trackers_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_project_trackers_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_project_trackers_id_seq OWNED BY public.sla_project_trackers.id;
CREATE TABLE public.sla_schedules ( id bigint NOT NULL, sla_calendar_id bigint, dow integer NOT NULL, start_time time without time zone NOT NULL, end_time time without time zone NOT NULL, match boolean NOT NULL );
ALTER TABLE public.sla_schedules OWNER TO postgres;
CREATE SEQUENCE public.sla_schedules_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_schedules_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_schedules_id_seq OWNED BY public.sla_schedules.id;
CREATE TABLE public.sla_statuses ( id bigint NOT NULL, status_id bigint, sla_type_id bigint );
ALTER TABLE public.sla_statuses OWNER TO postgres;
CREATE SEQUENCE public.sla_statuses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_statuses_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_statuses_id_seq OWNED BY public.sla_statuses.id;
CREATE TABLE public.sla_types ( id bigint NOT NULL, name text NOT NULL );
ALTER TABLE public.sla_types OWNER TO postgres;
CREATE SEQUENCE public.sla_types_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.sla_types_id_seq OWNER TO postgres;
ALTER SEQUENCE public.sla_types_id_seq OWNED BY public.sla_types.id;
CREATE TABLE redmine.issues ( id bigint NOT NULL, tracker_id bigint NOT NULL, project_id bigint NOT NULL, subject character varying(255) DEFAULT ''::character varying NOT NULL, description text, due_date date, category_id bigint, status_id bigint NOT NULL, assigned_to_id bigint, priority_id bigint NOT NULL, fixed_version_id bigint, author_id bigint NOT NULL, lock_version bigint DEFAULT '0'::bigint NOT NULL, created_on timestamp with time zone, updated_on timestamp with time zone, start_date date, done_ratio bigint DEFAULT '0'::bigint NOT NULL, estimated_hours double precision, parent_id bigint, root_id bigint, lft bigint, rgt bigint, is_private boolean DEFAULT false NOT NULL, closed_on timestamp with time zone );
ALTER TABLE redmine.issues OWNER TO postgres;
CREATE TABLE redmine.journal_details ( id bigint NOT NULL, journal_id bigint DEFAULT '0'::bigint NOT NULL, property character varying(30) DEFAULT ''::character varying NOT NULL, prop_key character varying(30) DEFAULT ''::character varying NOT NULL, old_value text, value text );
ALTER TABLE redmine.journal_details OWNER TO postgres;
CREATE TABLE redmine.journals ( id bigint NOT NULL, journalized_id bigint DEFAULT '0'::bigint NOT NULL, journalized_type character varying(30) DEFAULT ''::character varying NOT NULL, user_id bigint DEFAULT '0'::bigint NOT NULL, notes text, created_on timestamp with time zone NOT NULL, private_notes boolean DEFAULT false NOT NULL, updated_on timestamp without time zone, updated_by_id integer );
ALTER TABLE redmine.journals OWNER TO postgres;
CREATE VIEW public.sla_view_journal_statuses AS SELECT (issues.id)::integer AS issue_id, redmine.sla_get_date((issues.created_on)::timestamp without time zone) AS issue_created_on, redmine.sla_get_date((issues.closed_on)::timestamp without time zone) AS issue_closed_on, redmine.sla_get_date((journals.created_on)::timestamp without time zone) AS journals_created_on, (journal_details.old_value)::integer AS journal_detail_old_value, (journal_details.value)::integer AS journal_detail_value FROM ((redmine.issues JOIN redmine.journals ON ((issues.id = journals.journalized_id))) JOIN redmine.journal_details ON (((journals.id = journal_details.journal_id) AND ((journal_details.property)::text ~~ 'attr'::text) AND ((journal_details.prop_key)::text ~~ 'status_id'::text))));
ALTER VIEW public.sla_view_journal_statuses OWNER TO postgres;
CREATE VIEW public.sla_view_roll_statuses AS SELECT sla_view_journal_statuses.issue_id, first_value(sla_view_journal_statuses.journal_detail_old_value) OVER window_status AS from_status_id, sla_view_journal_statuses.issue_created_on AS from_status_date, first_value(sla_view_journal_statuses.journal_detail_old_value) OVER window_status AS to_status_id, sla_view_journal_statuses.issue_created_on AS to_status_date FROM public.sla_view_journal_statuses WINDOW window_status AS (PARTITION BY sla_view_journal_statuses.issue_id ORDER BY sla_view_journal_statuses.journals_created_on) UNION SELECT sla_view_journal_statuses.issue_id, sla_view_journal_statuses.journal_detail_old_value AS from_status_id, lag(sla_view_journal_statuses.journals_created_on, 1, sla_view_journal_statuses.issue_created_on) OVER window_status AS from_status_date, sla_view_journal_statuses.journal_detail_value AS to_status_id, sla_view_journal_statuses.journals_created_on AS to_status_date FROM public.sla_view_journal_statuses WINDOW window_status AS (PARTITION BY sla_view_journal_statuses.issue_id ORDER BY sla_view_journal_statuses.journals_created_on) UNION SELECT sla_view_journal_statuses.issue_id, first_value(sla_view_journal_statuses.journal_detail_value) OVER window_status AS from_status_id, first_value(sla_view_journal_statuses.journals_created_on) OVER window_status AS from_status_date, first_value(sla_view_journal_statuses.journal_detail_value) OVER window_status AS to_status_id, COALESCE(sla_view_journal_statuses.issue_closed_on, redmine.sla_get_date((now())::timestamp without time zone)) AS to_status_date FROM public.sla_view_journal_statuses WINDOW window_status AS (PARTITION BY sla_view_journal_statuses.issue_id ORDER BY sla_view_journal_statuses.journals_created_on DESC);
ALTER VIEW public.sla_view_roll_statuses OWNER TO postgres;
CREATE TABLE public.slas ( id bigint NOT NULL, name text NOT NULL );
ALTER TABLE public.slas OWNER TO postgres;
CREATE SEQUENCE public.slas_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE public.slas_id_seq OWNER TO postgres;
ALTER SEQUENCE public.slas_id_seq OWNED BY public.slas.id;
CREATE TABLE redmine.addresses ( id bigint NOT NULL, street1 character varying(255), street2 character varying(255), city character varying(255), region character varying(255), postcode character varying(255), country_code character varying(2), full_address text, address_type character varying(16), addressable_type character varying(255), addressable_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL );
ALTER TABLE redmine.addresses OWNER TO postgres;
CREATE SEQUENCE redmine.addresses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.addresses_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.addresses_id_seq OWNED BY redmine.addresses.id;
CREATE TABLE redmine.agile_colors ( id bigint NOT NULL, container_id bigint, container_type character varying(255), color character varying(255) );
ALTER TABLE redmine.agile_colors OWNER TO postgres;
CREATE SEQUENCE redmine.agile_colors_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.agile_colors_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.agile_colors_id_seq OWNED BY redmine.agile_colors.id;
CREATE TABLE redmine.agile_data ( id bigint NOT NULL, issue_id bigint, "position" bigint, story_points bigint, agile_sprint_id bigint );
ALTER TABLE redmine.agile_data OWNER TO postgres;
CREATE SEQUENCE redmine.agile_data_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.agile_data_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.agile_data_id_seq OWNED BY redmine.agile_data.id;
CREATE TABLE redmine.agile_sprints ( id bigint NOT NULL, project_id bigint, name character varying(255) NOT NULL, description text, status bigint DEFAULT '0'::bigint NOT NULL, start_date date NOT NULL, end_date date NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, sharing bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.agile_sprints OWNER TO postgres;
CREATE SEQUENCE redmine.agile_sprints_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.agile_sprints_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.agile_sprints_id_seq OWNED BY redmine.agile_sprints.id;
CREATE TABLE redmine.ar_internal_metadata ( key character varying(255) NOT NULL, value character varying(255), created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL );
ALTER TABLE redmine.ar_internal_metadata OWNER TO postgres;
CREATE TABLE redmine.attachments ( id bigint NOT NULL, container_id bigint, container_type character varying(30), filename character varying(255) DEFAULT ''::character varying NOT NULL, disk_filename character varying(255) DEFAULT ''::character varying NOT NULL, filesize bigint DEFAULT '0'::bigint NOT NULL, content_type character varying(255) DEFAULT ''::character varying, digest character varying(64) DEFAULT ''::character varying NOT NULL, downloads bigint DEFAULT '0'::bigint NOT NULL, author_id bigint DEFAULT '0'::bigint NOT NULL, created_on timestamp with time zone, description character varying(255), disk_directory character varying(255) );
ALTER TABLE redmine.attachments OWNER TO postgres;
CREATE SEQUENCE redmine.attachments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.attachments_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.attachments_id_seq OWNED BY redmine.attachments.id;
CREATE TABLE redmine.auth_sources ( id bigint NOT NULL, type character varying(30) DEFAULT ''::character varying NOT NULL, name character varying(60) DEFAULT ''::character varying NOT NULL, host character varying(60), port bigint, account character varying(255), account_password character varying(255) DEFAULT ''::character varying, base_dn character varying(255), attr_login character varying(30), attr_firstname character varying(30), attr_lastname character varying(30), attr_mail character varying(30), onthefly_register boolean DEFAULT false NOT NULL, tls boolean DEFAULT false NOT NULL, filter text, timeout bigint, verify_peer boolean DEFAULT true NOT NULL );
ALTER TABLE redmine.auth_sources OWNER TO postgres;
CREATE SEQUENCE redmine.auth_sources_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.auth_sources_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.auth_sources_id_seq OWNED BY redmine.auth_sources.id;
CREATE TABLE redmine.boards ( id bigint NOT NULL, project_id bigint NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL, description character varying(255), "position" bigint, topics_count bigint DEFAULT '0'::bigint NOT NULL, messages_count bigint DEFAULT '0'::bigint NOT NULL, last_message_id bigint, parent_id bigint );
ALTER TABLE redmine.boards OWNER TO postgres;
CREATE SEQUENCE redmine.boards_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.boards_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.boards_id_seq OWNED BY redmine.boards.id;
CREATE TABLE redmine.canned_responses ( id bigint NOT NULL, name character varying(255), content text, project_id bigint, user_id bigint, is_public boolean );
ALTER TABLE redmine.canned_responses OWNER TO postgres;
CREATE SEQUENCE redmine.canned_responses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.canned_responses_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.canned_responses_id_seq OWNED BY redmine.canned_responses.id;
CREATE TABLE redmine.changes ( id bigint NOT NULL, changeset_id bigint NOT NULL, action character varying(1) DEFAULT ''::character varying NOT NULL, path text NOT NULL, from_path text, from_revision character varying(255), revision character varying(255), branch character varying(255) );
ALTER TABLE redmine.changes OWNER TO postgres;
CREATE SEQUENCE redmine.changes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.changes_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.changes_id_seq OWNED BY redmine.changes.id;
CREATE TABLE redmine.changeset_parents ( changeset_id bigint NOT NULL, parent_id bigint NOT NULL );
ALTER TABLE redmine.changeset_parents OWNER TO postgres;
CREATE TABLE redmine.changesets ( id bigint NOT NULL, repository_id bigint NOT NULL, revision character varying(255) NOT NULL, committer character varying(255), committed_on timestamp with time zone NOT NULL, comments text, commit_date date, scmid character varying(255), user_id bigint );
ALTER TABLE redmine.changesets OWNER TO postgres;
CREATE SEQUENCE redmine.changesets_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.changesets_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.changesets_id_seq OWNED BY redmine.changesets.id;
CREATE TABLE redmine.changesets_issues ( changeset_id bigint NOT NULL, issue_id bigint NOT NULL );
ALTER TABLE redmine.changesets_issues OWNER TO postgres;
CREATE TABLE redmine.checklist_template_categories ( id bigint NOT NULL, name character varying(255), "position" bigint DEFAULT '1'::bigint );
ALTER TABLE redmine.checklist_template_categories OWNER TO postgres;
CREATE SEQUENCE redmine.checklist_template_categories_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.checklist_template_categories_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.checklist_template_categories_id_seq OWNED BY redmine.checklist_template_categories.id;
CREATE TABLE redmine.checklist_templates ( id bigint NOT NULL, name character varying(255), project_id bigint, category_id bigint, user_id bigint, is_public boolean, template_items text, is_default boolean DEFAULT false, tracker_id bigint );
ALTER TABLE redmine.checklist_templates OWNER TO postgres;
CREATE SEQUENCE redmine.checklist_templates_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.checklist_templates_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.checklist_templates_id_seq OWNED BY redmine.checklist_templates.id;
CREATE TABLE redmine.checklists ( id bigint NOT NULL, is_done boolean DEFAULT false, subject character varying(512), "position" bigint DEFAULT '1'::bigint, issue_id bigint NOT NULL, created_at timestamp with time zone, updated_at timestamp with time zone, is_section boolean DEFAULT false );
ALTER TABLE redmine.checklists OWNER TO postgres;
CREATE SEQUENCE redmine.checklists_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.checklists_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.checklists_id_seq OWNED BY redmine.checklists.id;
CREATE TABLE redmine.comments ( id bigint NOT NULL, commented_type character varying(30) DEFAULT ''::character varying NOT NULL, commented_id bigint DEFAULT '0'::bigint NOT NULL, author_id bigint DEFAULT '0'::bigint NOT NULL, content text, created_on timestamp with time zone NOT NULL, updated_on timestamp with time zone NOT NULL );
ALTER TABLE redmine.comments OWNER TO postgres;
CREATE SEQUENCE redmine.comments_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.comments_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.comments_id_seq OWNED BY redmine.comments.id;
CREATE TABLE redmine.contacts ( id bigint NOT NULL, first_name character varying(255), last_name character varying(255), middle_name character varying(255), company character varying(255), phone character varying(255), email character varying(255), website character varying(255), skype_name character varying(255), birthday date, avatar character varying(255), background text, job_title character varying(255), is_company boolean DEFAULT false, author_id bigint DEFAULT '0'::bigint NOT NULL, assigned_to_id bigint, created_on timestamp with time zone, updated_on timestamp with time zone, cached_tag_list character varying(255), visibility bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.contacts OWNER TO postgres;
CREATE TABLE redmine.contacts_deals ( deal_id bigint, contact_id bigint );
ALTER TABLE redmine.contacts_deals OWNER TO postgres;
CREATE SEQUENCE redmine.contacts_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.contacts_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.contacts_id_seq OWNED BY redmine.contacts.id;
CREATE TABLE redmine.contacts_issues ( issue_id bigint DEFAULT '0'::bigint NOT NULL, contact_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.contacts_issues OWNER TO postgres;
CREATE TABLE redmine.contacts_projects ( project_id bigint DEFAULT '0'::bigint NOT NULL, contact_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.contacts_projects OWNER TO postgres;
CREATE TABLE redmine.contacts_queries ( id bigint NOT NULL, project_id bigint, name character varying(255) DEFAULT ''::character varying NOT NULL, filters text, user_id bigint DEFAULT '0'::bigint NOT NULL, is_public boolean DEFAULT false NOT NULL, column_names text, sort_criteria text, group_by character varying(255), type character varying(255) );
ALTER TABLE redmine.contacts_queries OWNER TO postgres;
CREATE SEQUENCE redmine.contacts_queries_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.contacts_queries_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.contacts_queries_id_seq OWNED BY redmine.contacts_queries.id;
CREATE TABLE redmine.custom_field_enumerations ( id bigint NOT NULL, custom_field_id bigint NOT NULL, name character varying(255) NOT NULL, active boolean DEFAULT true NOT NULL, "position" bigint DEFAULT '1'::bigint NOT NULL );
ALTER TABLE redmine.custom_field_enumerations OWNER TO postgres;
CREATE SEQUENCE redmine.custom_field_enumerations_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.custom_field_enumerations_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.custom_field_enumerations_id_seq OWNED BY redmine.custom_field_enumerations.id;
CREATE TABLE redmine.custom_fields ( id bigint NOT NULL, type character varying(30) DEFAULT ''::character varying NOT NULL, name character varying(30) DEFAULT ''::character varying NOT NULL, field_format character varying(30) DEFAULT ''::character varying NOT NULL, possible_values text, regexp character varying(255) DEFAULT ''::character varying, min_length bigint, max_length bigint, is_required boolean DEFAULT false NOT NULL, is_for_all boolean DEFAULT false NOT NULL, is_filter boolean DEFAULT false NOT NULL, "position" bigint, searchable boolean DEFAULT false, default_value text, editable boolean DEFAULT true, visible boolean DEFAULT true NOT NULL, multiple boolean DEFAULT false, format_store text, description text );
ALTER TABLE redmine.custom_fields OWNER TO postgres;
CREATE SEQUENCE redmine.custom_fields_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.custom_fields_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.custom_fields_id_seq OWNED BY redmine.custom_fields.id;
CREATE TABLE redmine.custom_fields_projects ( custom_field_id bigint DEFAULT '0'::bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.custom_fields_projects OWNER TO postgres;
CREATE TABLE redmine.custom_fields_roles ( custom_field_id bigint NOT NULL, role_id bigint NOT NULL );
ALTER TABLE redmine.custom_fields_roles OWNER TO postgres;
CREATE TABLE redmine.custom_fields_trackers ( custom_field_id bigint DEFAULT '0'::bigint NOT NULL, tracker_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.custom_fields_trackers OWNER TO postgres;
CREATE TABLE redmine.custom_values ( id bigint NOT NULL, customized_type character varying(30) DEFAULT ''::character varying NOT NULL, customized_id bigint DEFAULT '0'::bigint NOT NULL, custom_field_id bigint DEFAULT '0'::bigint NOT NULL, value text );
ALTER TABLE redmine.custom_values OWNER TO postgres;
CREATE SEQUENCE redmine.custom_values_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.custom_values_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.custom_values_id_seq OWNED BY redmine.custom_values.id;
CREATE TABLE redmine.deal_categories ( id bigint NOT NULL, name character varying(255) NOT NULL, project_id bigint );
ALTER TABLE redmine.deal_categories OWNER TO postgres;
CREATE SEQUENCE redmine.deal_categories_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.deal_categories_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.deal_categories_id_seq OWNED BY redmine.deal_categories.id;
CREATE TABLE redmine.deal_processes ( id bigint NOT NULL, deal_id bigint NOT NULL, author_id bigint NOT NULL, old_value bigint, value bigint NOT NULL, created_at timestamp with time zone );
ALTER TABLE redmine.deal_processes OWNER TO postgres;
CREATE SEQUENCE redmine.deal_processes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.deal_processes_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.deal_processes_id_seq OWNED BY redmine.deal_processes.id;
CREATE TABLE redmine.deal_statuses ( id bigint NOT NULL, name character varying(255) NOT NULL, "position" bigint, is_default boolean DEFAULT false NOT NULL, color bigint DEFAULT '11184810'::bigint NOT NULL, status_type bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.deal_statuses OWNER TO postgres;
CREATE SEQUENCE redmine.deal_statuses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.deal_statuses_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.deal_statuses_id_seq OWNED BY redmine.deal_statuses.id;
CREATE TABLE redmine.deal_statuses_projects ( project_id bigint DEFAULT '0'::bigint NOT NULL, deal_status_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.deal_statuses_projects OWNER TO postgres;
CREATE TABLE redmine.deals ( id bigint NOT NULL, name character varying(255), background text, currency character varying(255), duration bigint DEFAULT '1'::bigint, price numeric(20,2), price_type bigint, project_id bigint, author_id bigint, assigned_to_id bigint, status_id bigint, contact_id bigint, category_id bigint, created_on timestamp with time zone, updated_on timestamp with time zone, due_date timestamp with time zone, probability bigint );
ALTER TABLE redmine.deals OWNER TO postgres;
CREATE SEQUENCE redmine.deals_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.deals_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.deals_id_seq OWNED BY redmine.deals.id;
CREATE TABLE redmine.deals_issues ( id bigint NOT NULL, issue_id bigint DEFAULT '0'::bigint NOT NULL, deal_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.deals_issues OWNER TO postgres;
CREATE SEQUENCE redmine.deals_issues_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.deals_issues_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.deals_issues_id_seq OWNED BY redmine.deals_issues.id;
CREATE TABLE redmine.documents ( id bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL, category_id bigint DEFAULT '0'::bigint NOT NULL, title character varying(255) DEFAULT ''::character varying NOT NULL, description text, created_on timestamp with time zone );
ALTER TABLE redmine.documents OWNER TO postgres;
CREATE SEQUENCE redmine.documents_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.documents_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.documents_id_seq OWNED BY redmine.documents.id;
CREATE TABLE redmine.email_addresses ( id bigint NOT NULL, user_id bigint NOT NULL, address character varying(255) NOT NULL, is_default boolean DEFAULT false NOT NULL, notify boolean DEFAULT true NOT NULL, created_on timestamp with time zone NOT NULL, updated_on timestamp with time zone NOT NULL );
ALTER TABLE redmine.email_addresses OWNER TO postgres;
CREATE SEQUENCE redmine.email_addresses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.email_addresses_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.email_addresses_id_seq OWNED BY redmine.email_addresses.id;
CREATE TABLE redmine.enabled_modules ( id bigint NOT NULL, project_id bigint, name character varying(255) NOT NULL );
ALTER TABLE redmine.enabled_modules OWNER TO postgres;
CREATE SEQUENCE redmine.enabled_modules_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.enabled_modules_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.enabled_modules_id_seq OWNED BY redmine.enabled_modules.id;
CREATE TABLE redmine.enumerations ( id bigint NOT NULL, name character varying(30) DEFAULT ''::character varying NOT NULL, "position" bigint, is_default boolean DEFAULT false NOT NULL, type character varying(255), active boolean DEFAULT true NOT NULL, project_id bigint, parent_id bigint, position_name character varying(30) );
ALTER TABLE redmine.enumerations OWNER TO postgres;
CREATE SEQUENCE redmine.enumerations_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.enumerations_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.enumerations_id_seq OWNED BY redmine.enumerations.id;
CREATE TABLE redmine.favorite_projects ( id bigint NOT NULL, user_id bigint, project_id bigint );
ALTER TABLE redmine.favorite_projects OWNER TO postgres;
CREATE SEQUENCE redmine.favorite_projects_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.favorite_projects_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.favorite_projects_id_seq OWNED BY redmine.favorite_projects.id;
CREATE TABLE redmine.groups_users ( group_id bigint NOT NULL, user_id bigint NOT NULL );
ALTER TABLE redmine.groups_users OWNER TO postgres;
CREATE TABLE redmine.helpdesk_mail_rules ( id bigint NOT NULL, mail_type bigint, conditions text, actions text, user_id bigint NOT NULL, "position" bigint DEFAULT '0'::bigint );
ALTER TABLE redmine.helpdesk_mail_rules OWNER TO postgres;
CREATE SEQUENCE redmine.helpdesk_mail_rules_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.helpdesk_mail_rules_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.helpdesk_mail_rules_id_seq OWNED BY redmine.helpdesk_mail_rules.id;
CREATE TABLE redmine.helpdesk_tickets ( id bigint NOT NULL, contact_id bigint, issue_id bigint, source bigint DEFAULT '0'::bigint NOT NULL, from_address character varying(255), to_address character varying(255), ticket_date timestamp with time zone, cc_address character varying(255), message_id character varying(255), is_incoming boolean DEFAULT true, reaction_time bigint, first_response_time bigint, resolve_time bigint, last_agent_response_at timestamp with time zone, last_customer_response_at timestamp with time zone, vote bigint, vote_comment character varying(255), view_id character varying(255), viewed_on timestamp with time zone );
ALTER TABLE redmine.helpdesk_tickets OWNER TO postgres;
CREATE SEQUENCE redmine.helpdesk_tickets_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.helpdesk_tickets_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.helpdesk_tickets_id_seq OWNED BY redmine.helpdesk_tickets.id;
CREATE TABLE redmine.import_items ( id bigint NOT NULL, import_id bigint NOT NULL, "position" bigint NOT NULL, obj_id bigint, message text, unique_id character varying );
ALTER TABLE redmine.import_items OWNER TO postgres;
CREATE SEQUENCE redmine.import_items_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.import_items_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.import_items_id_seq OWNED BY redmine.import_items.id;
CREATE TABLE redmine.imports ( id bigint NOT NULL, type character varying(255), user_id bigint NOT NULL, filename character varying(255), settings text, total_items bigint, finished boolean DEFAULT false NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL );
ALTER TABLE redmine.imports OWNER TO postgres;
CREATE SEQUENCE redmine.imports_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.imports_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.imports_id_seq OWNED BY redmine.imports.id;
CREATE TABLE redmine.issue_categories ( id bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL, name character varying(60) DEFAULT ''::character varying NOT NULL, assigned_to_id bigint );
ALTER TABLE redmine.issue_categories OWNER TO postgres;
CREATE SEQUENCE redmine.issue_categories_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.issue_categories_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.issue_categories_id_seq OWNED BY redmine.issue_categories.id;
CREATE TABLE redmine.issue_relations ( id bigint NOT NULL, issue_from_id bigint NOT NULL, issue_to_id bigint NOT NULL, relation_type character varying(255) DEFAULT ''::character varying NOT NULL, delay bigint );
ALTER TABLE redmine.issue_relations OWNER TO postgres;
CREATE SEQUENCE redmine.issue_relations_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.issue_relations_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.issue_relations_id_seq OWNED BY redmine.issue_relations.id;
CREATE TABLE redmine.issue_statuses ( id bigint NOT NULL, name character varying(30) DEFAULT ''::character varying NOT NULL, is_closed boolean DEFAULT false NOT NULL, "position" bigint, default_done_ratio bigint, description character varying );
ALTER TABLE redmine.issue_statuses OWNER TO postgres;
CREATE SEQUENCE redmine.issue_statuses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.issue_statuses_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.issue_statuses_id_seq OWNED BY redmine.issue_statuses.id;
CREATE SEQUENCE redmine.issues_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.issues_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.issues_id_seq OWNED BY redmine.issues.id;
CREATE SEQUENCE redmine.journal_details_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.journal_details_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.journal_details_id_seq OWNED BY redmine.journal_details.id;
CREATE TABLE redmine.journal_messages ( id bigint NOT NULL, contact_id bigint, journal_id bigint, is_incoming boolean, source bigint DEFAULT '0'::bigint NOT NULL, from_address character varying(255), to_address character varying(255), bcc_address character varying(255), cc_address character varying(255), message_date timestamp with time zone, message_id character varying(255), view_id character varying(255), viewed_on timestamp with time zone );
ALTER TABLE redmine.journal_messages OWNER TO postgres;
CREATE SEQUENCE redmine.journal_messages_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.journal_messages_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.journal_messages_id_seq OWNED BY redmine.journal_messages.id;
CREATE SEQUENCE redmine.journals_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.journals_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.journals_id_seq OWNED BY redmine.journals.id;
CREATE TABLE redmine.member_roles ( id bigint NOT NULL, member_id bigint NOT NULL, role_id bigint NOT NULL, inherited_from bigint );
ALTER TABLE redmine.member_roles OWNER TO postgres;
CREATE SEQUENCE redmine.member_roles_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.member_roles_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.member_roles_id_seq OWNED BY redmine.member_roles.id;
CREATE TABLE redmine.members ( id bigint NOT NULL, user_id bigint DEFAULT '0'::bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL, created_on timestamp with time zone, mail_notification boolean DEFAULT false NOT NULL );
ALTER TABLE redmine.members OWNER TO postgres;
CREATE SEQUENCE redmine.members_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.members_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.members_id_seq OWNED BY redmine.members.id;
CREATE TABLE redmine.messages ( id bigint NOT NULL, board_id bigint NOT NULL, parent_id bigint, subject character varying(255) DEFAULT ''::character varying NOT NULL, content text, author_id bigint, replies_count bigint DEFAULT '0'::bigint NOT NULL, last_reply_id bigint, created_on timestamp with time zone NOT NULL, updated_on timestamp with time zone NOT NULL, locked boolean DEFAULT false, sticky bigint DEFAULT '0'::bigint );
ALTER TABLE redmine.messages OWNER TO postgres;
CREATE SEQUENCE redmine.messages_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.messages_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.messages_id_seq OWNED BY redmine.messages.id;
CREATE TABLE redmine.news ( id bigint NOT NULL, project_id bigint, title character varying(60) DEFAULT ''::character varying NOT NULL, summary character varying(255) DEFAULT ''::character varying, description text, author_id bigint DEFAULT '0'::bigint NOT NULL, created_on timestamp with time zone, comments_count bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.news OWNER TO postgres;
CREATE SEQUENCE redmine.news_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.news_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.news_id_seq OWNED BY redmine.news.id;
CREATE TABLE redmine.notes ( id bigint NOT NULL, subject character varying(255), content text, source_id bigint, source_type character varying(255), author_id bigint, created_on timestamp with time zone, updated_on timestamp with time zone, type_id bigint );
ALTER TABLE redmine.notes OWNER TO postgres;
CREATE SEQUENCE redmine.notes_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.notes_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.notes_id_seq OWNED BY redmine.notes.id;
CREATE TABLE redmine.periodictasks ( id bigint NOT NULL, project_id bigint, tracker_id bigint, assigned_to_id bigint, author_id bigint, subject character varying(255), interval_number bigint, interval_units character varying(255), last_assigned_date timestamp with time zone, next_run_date timestamp with time zone, set_start_date boolean DEFAULT false NOT NULL, due_date_number bigint, due_date_units character varying(255), description text, issue_category_id bigint, estimated_hours double precision, checklists_template_id bigint, last_error character varying(255), custom_field_values text );
ALTER TABLE redmine.periodictasks OWNER TO postgres;
CREATE SEQUENCE redmine.periodictasks_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.periodictasks_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.periodictasks_id_seq OWNED BY redmine.periodictasks.id;
CREATE TABLE redmine.projects ( id bigint NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL, description text, homepage character varying(255) DEFAULT ''::character varying, is_public boolean DEFAULT true NOT NULL, parent_id bigint, created_on timestamp with time zone, updated_on timestamp with time zone, identifier character varying(255), status bigint DEFAULT '1'::bigint NOT NULL, lft bigint, rgt bigint, inherit_members boolean DEFAULT false NOT NULL, default_version_id bigint, default_assigned_to_id bigint, default_issue_query_id integer );
ALTER TABLE redmine.projects OWNER TO postgres;
CREATE SEQUENCE redmine.projects_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.projects_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.projects_id_seq OWNED BY redmine.projects.id;
CREATE TABLE redmine.projects_trackers ( project_id bigint DEFAULT '0'::bigint NOT NULL, tracker_id bigint DEFAULT '0'::bigint NOT NULL );
ALTER TABLE redmine.projects_trackers OWNER TO postgres;
CREATE TABLE redmine.queries ( id bigint NOT NULL, project_id bigint, name character varying(255) DEFAULT ''::character varying NOT NULL, filters text, user_id bigint DEFAULT '0'::bigint NOT NULL, column_names text, sort_criteria text, group_by character varying(255), type character varying(255), visibility bigint DEFAULT '0'::bigint, options text );
ALTER TABLE redmine.queries OWNER TO postgres;
CREATE SEQUENCE redmine.queries_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.queries_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.queries_id_seq OWNED BY redmine.queries.id;
CREATE TABLE redmine.queries_roles ( query_id bigint NOT NULL, role_id bigint NOT NULL );
ALTER TABLE redmine.queries_roles OWNER TO postgres;
CREATE TABLE redmine.repositories ( id bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL, url character varying(255) DEFAULT ''::character varying NOT NULL, login character varying(60) DEFAULT ''::character varying, password character varying(255) DEFAULT ''::character varying, root_url character varying(255) DEFAULT ''::character varying, type character varying(255), path_encoding character varying(64), log_encoding character varying(64), extra_info text, identifier character varying(255), is_default boolean DEFAULT false, created_on timestamp with time zone );
ALTER TABLE redmine.repositories OWNER TO postgres;
CREATE SEQUENCE redmine.repositories_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.repositories_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.repositories_id_seq OWNED BY redmine.repositories.id;
CREATE TABLE redmine.roles ( id bigint NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL, "position" bigint, assignable boolean DEFAULT true, builtin bigint DEFAULT '0'::bigint NOT NULL, permissions text, issues_visibility character varying(30) DEFAULT 'default'::character varying NOT NULL, users_visibility character varying(30) DEFAULT 'all'::character varying NOT NULL, time_entries_visibility character varying(30) DEFAULT 'all'::character varying NOT NULL, all_roles_managed boolean DEFAULT true NOT NULL, settings text, default_time_entry_activity_id integer );
ALTER TABLE redmine.roles OWNER TO postgres;
CREATE SEQUENCE redmine.roles_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.roles_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.roles_id_seq OWNED BY redmine.roles.id;
CREATE TABLE redmine.roles_managed_roles ( role_id bigint NOT NULL, managed_role_id bigint NOT NULL );
ALTER TABLE redmine.roles_managed_roles OWNER TO postgres;
CREATE TABLE redmine.schema_migrations ( version character varying(255) NOT NULL );
ALTER TABLE redmine.schema_migrations OWNER TO postgres;
CREATE TABLE redmine.settings ( id bigint NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL, value text, updated_on timestamp with time zone );
ALTER TABLE redmine.settings OWNER TO postgres;
CREATE SEQUENCE redmine.settings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.settings_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.settings_id_seq OWNED BY redmine.settings.id;
CREATE TABLE redmine.taggings ( id bigint NOT NULL, tag_id bigint, taggable_id bigint, taggable_type character varying(255), created_at timestamp with time zone );
ALTER TABLE redmine.taggings OWNER TO postgres;
CREATE SEQUENCE redmine.taggings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.taggings_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.taggings_id_seq OWNED BY redmine.taggings.id;
CREATE TABLE redmine.tags ( id bigint NOT NULL, name character varying(255) );
ALTER TABLE redmine.tags OWNER TO postgres;
CREATE SEQUENCE redmine.tags_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.tags_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.tags_id_seq OWNED BY redmine.tags.id;
CREATE TABLE redmine.time_entries ( id bigint NOT NULL, project_id bigint NOT NULL, user_id bigint NOT NULL, issue_id bigint, hours double precision NOT NULL, comments character varying(1024), activity_id bigint NOT NULL, spent_on date NOT NULL, tyear bigint NOT NULL, tmonth bigint NOT NULL, tweek bigint NOT NULL, created_on timestamp with time zone NOT NULL, updated_on timestamp with time zone NOT NULL, author_id integer );
ALTER TABLE redmine.time_entries OWNER TO postgres;
CREATE SEQUENCE redmine.time_entries_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.time_entries_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.time_entries_id_seq OWNED BY redmine.time_entries.id;
CREATE TABLE redmine.tokens ( id bigint NOT NULL, user_id bigint DEFAULT '0'::bigint NOT NULL, action character varying(30) DEFAULT ''::character varying NOT NULL, value character varying(40) DEFAULT ''::character varying NOT NULL, created_on timestamp with time zone NOT NULL, updated_on timestamp with time zone );
ALTER TABLE redmine.tokens OWNER TO postgres;
CREATE SEQUENCE redmine.tokens_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.tokens_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.tokens_id_seq OWNED BY redmine.tokens.id;
CREATE TABLE redmine.trackers ( id bigint NOT NULL, name character varying(30) DEFAULT ''::character varying NOT NULL, "position" bigint, is_in_roadmap boolean DEFAULT true NOT NULL, fields_bits bigint DEFAULT '0'::bigint, default_status_id bigint, description character varying );
ALTER TABLE redmine.trackers OWNER TO postgres;
CREATE SEQUENCE redmine.trackers_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.trackers_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.trackers_id_seq OWNED BY redmine.trackers.id;
CREATE TABLE redmine.user_preferences ( id bigint NOT NULL, user_id bigint DEFAULT '0'::bigint NOT NULL, others text, hide_mail boolean DEFAULT true, time_zone character varying(255), show_projects character varying(255) );
ALTER TABLE redmine.user_preferences OWNER TO postgres;
CREATE SEQUENCE redmine.user_preferences_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.user_preferences_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.user_preferences_id_seq OWNED BY redmine.user_preferences.id;
CREATE TABLE redmine.users ( id bigint NOT NULL, login character varying(255) DEFAULT ''::character varying NOT NULL, hashed_password character varying(40) DEFAULT ''::character varying NOT NULL, firstname character varying(30) DEFAULT ''::character varying NOT NULL, lastname character varying(255) DEFAULT ''::character varying NOT NULL, admin boolean DEFAULT false NOT NULL, status bigint DEFAULT '1'::bigint NOT NULL, last_login_on timestamp with time zone, language character varying(5) DEFAULT ''::character varying, auth_source_id bigint, created_on timestamp with time zone, updated_on timestamp with time zone, type character varying(255), mail_notification character varying(255) DEFAULT ''::character varying NOT NULL, salt character varying(64), must_change_passwd boolean DEFAULT false NOT NULL, passwd_changed_on timestamp with time zone, twofa_scheme character varying, twofa_totp_key character varying, twofa_totp_last_used_at integer, twofa_required boolean DEFAULT false );
ALTER TABLE redmine.users OWNER TO postgres;
CREATE SEQUENCE redmine.users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.users_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.users_id_seq OWNED BY redmine.users.id;
CREATE TABLE redmine.versions ( id bigint NOT NULL, project_id bigint DEFAULT '0'::bigint NOT NULL, name character varying(255) DEFAULT ''::character varying NOT NULL, description character varying(255) DEFAULT ''::character varying, effective_date date, created_on timestamp with time zone, updated_on timestamp with time zone, wiki_page_title character varying(255), status character varying(255) DEFAULT 'open'::character varying, sharing character varying(255) DEFAULT 'none'::character varying NOT NULL );
ALTER TABLE redmine.versions OWNER TO postgres;
CREATE SEQUENCE redmine.versions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.versions_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.versions_id_seq OWNED BY redmine.versions.id;
CREATE TABLE redmine.watchers ( id bigint NOT NULL, watchable_type character varying(255) DEFAULT ''::character varying NOT NULL, watchable_id bigint DEFAULT '0'::bigint NOT NULL, user_id bigint );
ALTER TABLE redmine.watchers OWNER TO postgres;
CREATE SEQUENCE redmine.watchers_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.watchers_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.watchers_id_seq OWNED BY redmine.watchers.id;
CREATE TABLE redmine.wiki_content_versions ( id bigint NOT NULL, wiki_content_id bigint NOT NULL, page_id bigint NOT NULL, author_id bigint, data bytea, compression character varying(6) DEFAULT ''::character varying, comments character varying(1024) DEFAULT ''::character varying, updated_on timestamp with time zone NOT NULL, version bigint NOT NULL );
ALTER TABLE redmine.wiki_content_versions OWNER TO postgres;
CREATE SEQUENCE redmine.wiki_content_versions_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.wiki_content_versions_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.wiki_content_versions_id_seq OWNED BY redmine.wiki_content_versions.id;
CREATE TABLE redmine.wiki_contents ( id bigint NOT NULL, page_id bigint NOT NULL, author_id bigint, text text, comments character varying(1024) DEFAULT ''::character varying, updated_on timestamp with time zone NOT NULL, version bigint NOT NULL );
ALTER TABLE redmine.wiki_contents OWNER TO postgres;
CREATE SEQUENCE redmine.wiki_contents_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.wiki_contents_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.wiki_contents_id_seq OWNED BY redmine.wiki_contents.id;
CREATE TABLE redmine.wiki_pages ( id bigint NOT NULL, wiki_id bigint NOT NULL, title character varying(255) NOT NULL, created_on timestamp with time zone NOT NULL, protected boolean DEFAULT false NOT NULL, parent_id bigint );
ALTER TABLE redmine.wiki_pages OWNER TO postgres;
CREATE SEQUENCE redmine.wiki_pages_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.wiki_pages_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.wiki_pages_id_seq OWNED BY redmine.wiki_pages.id;
CREATE TABLE redmine.wiki_redirects ( id bigint NOT NULL, wiki_id bigint NOT NULL, title character varying(255), redirects_to character varying(255), created_on timestamp with time zone NOT NULL, redirects_to_wiki_id bigint NOT NULL );
ALTER TABLE redmine.wiki_redirects OWNER TO postgres;
CREATE SEQUENCE redmine.wiki_redirects_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.wiki_redirects_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.wiki_redirects_id_seq OWNED BY redmine.wiki_redirects.id;
CREATE TABLE redmine.wikis ( id bigint NOT NULL, project_id bigint NOT NULL, start_page character varying(255) NOT NULL, status bigint DEFAULT '1'::bigint NOT NULL );
ALTER TABLE redmine.wikis OWNER TO postgres;
CREATE SEQUENCE redmine.wikis_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.wikis_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.wikis_id_seq OWNED BY redmine.wikis.id;
CREATE TABLE redmine.workflows ( id bigint NOT NULL, tracker_id bigint DEFAULT '0'::bigint NOT NULL, old_status_id bigint DEFAULT '0'::bigint NOT NULL, new_status_id bigint DEFAULT '0'::bigint NOT NULL, role_id bigint DEFAULT '0'::bigint NOT NULL, assignee boolean DEFAULT false NOT NULL, author boolean DEFAULT false NOT NULL, type character varying(30), field_name character varying(30), rule character varying(30) );
ALTER TABLE redmine.workflows OWNER TO postgres;
CREATE SEQUENCE redmine.workflows_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER SEQUENCE redmine.workflows_id_seq OWNER TO postgres;
ALTER SEQUENCE redmine.workflows_id_seq OWNED BY redmine.workflows.id;
ALTER TABLE ONLY public.sla_caches ALTER COLUMN id SET DEFAULT nextval('public.sla_caches_id_seq'::regclass);
ALTER TABLE ONLY public.sla_calendar_holidays ALTER COLUMN id SET DEFAULT nextval('public.sla_calendar_holidays_id_seq'::regclass);
ALTER TABLE ONLY public.sla_calendars ALTER COLUMN id SET DEFAULT nextval('public.sla_calendars_id_seq'::regclass);
ALTER TABLE ONLY public.sla_holidays ALTER COLUMN id SET DEFAULT nextval('public.sla_holidays_id_seq'::regclass);
ALTER TABLE ONLY public.sla_level_terms ALTER COLUMN id SET DEFAULT nextval('public.sla_level_terms_id_seq'::regclass);
ALTER TABLE ONLY public.sla_levels ALTER COLUMN id SET DEFAULT nextval('public.sla_levels_id_seq'::regclass);
ALTER TABLE ONLY public.sla_logs ALTER COLUMN id SET DEFAULT nextval('public.sla_logs_id_seq'::regclass);
ALTER TABLE ONLY public.sla_project_trackers ALTER COLUMN id SET DEFAULT nextval('public.sla_project_trackers_id_seq'::regclass);
ALTER TABLE ONLY public.sla_schedules ALTER COLUMN id SET DEFAULT nextval('public.sla_schedules_id_seq'::regclass);
ALTER TABLE ONLY public.sla_statuses ALTER COLUMN id SET DEFAULT nextval('public.sla_statuses_id_seq'::regclass);
ALTER TABLE ONLY public.sla_types ALTER COLUMN id SET DEFAULT nextval('public.sla_types_id_seq'::regclass);
ALTER TABLE ONLY public.slas ALTER COLUMN id SET DEFAULT nextval('public.slas_id_seq'::regclass);
ALTER TABLE ONLY redmine.addresses ALTER COLUMN id SET DEFAULT nextval('redmine.addresses_id_seq'::regclass);
ALTER TABLE ONLY redmine.agile_colors ALTER COLUMN id SET DEFAULT nextval('redmine.agile_colors_id_seq'::regclass);
ALTER TABLE ONLY redmine.agile_data ALTER COLUMN id SET DEFAULT nextval('redmine.agile_data_id_seq'::regclass);
ALTER TABLE ONLY redmine.agile_sprints ALTER COLUMN id SET DEFAULT nextval('redmine.agile_sprints_id_seq'::regclass);
ALTER TABLE ONLY redmine.attachments ALTER COLUMN id SET DEFAULT nextval('redmine.attachments_id_seq'::regclass);
ALTER TABLE ONLY redmine.auth_sources ALTER COLUMN id SET DEFAULT nextval('redmine.auth_sources_id_seq'::regclass);
ALTER TABLE ONLY redmine.boards ALTER COLUMN id SET DEFAULT nextval('redmine.boards_id_seq'::regclass);
ALTER TABLE ONLY redmine.canned_responses ALTER COLUMN id SET DEFAULT nextval('redmine.canned_responses_id_seq'::regclass);
ALTER TABLE ONLY redmine.changes ALTER COLUMN id SET DEFAULT nextval('redmine.changes_id_seq'::regclass);
ALTER TABLE ONLY redmine.changesets ALTER COLUMN id SET DEFAULT nextval('redmine.changesets_id_seq'::regclass);
ALTER TABLE ONLY redmine.checklist_template_categories ALTER COLUMN id SET DEFAULT nextval('redmine.checklist_template_categories_id_seq'::regclass);
ALTER TABLE ONLY redmine.checklist_templates ALTER COLUMN id SET DEFAULT nextval('redmine.checklist_templates_id_seq'::regclass);
ALTER TABLE ONLY redmine.checklists ALTER COLUMN id SET DEFAULT nextval('redmine.checklists_id_seq'::regclass);
ALTER TABLE ONLY redmine.comments ALTER COLUMN id SET DEFAULT nextval('redmine.comments_id_seq'::regclass);
ALTER TABLE ONLY redmine.contacts ALTER COLUMN id SET DEFAULT nextval('redmine.contacts_id_seq'::regclass);
ALTER TABLE ONLY redmine.contacts_queries ALTER COLUMN id SET DEFAULT nextval('redmine.contacts_queries_id_seq'::regclass);
ALTER TABLE ONLY redmine.custom_field_enumerations ALTER COLUMN id SET DEFAULT nextval('redmine.custom_field_enumerations_id_seq'::regclass);
ALTER TABLE ONLY redmine.custom_fields ALTER COLUMN id SET DEFAULT nextval('redmine.custom_fields_id_seq'::regclass);
ALTER TABLE ONLY redmine.custom_values ALTER COLUMN id SET DEFAULT nextval('redmine.custom_values_id_seq'::regclass);
ALTER TABLE ONLY redmine.deal_categories ALTER COLUMN id SET DEFAULT nextval('redmine.deal_categories_id_seq'::regclass);
ALTER TABLE ONLY redmine.deal_processes ALTER COLUMN id SET DEFAULT nextval('redmine.deal_processes_id_seq'::regclass);
ALTER TABLE ONLY redmine.deal_statuses ALTER COLUMN id SET DEFAULT nextval('redmine.deal_statuses_id_seq'::regclass);
ALTER TABLE ONLY redmine.deals ALTER COLUMN id SET DEFAULT nextval('redmine.deals_id_seq'::regclass);
ALTER TABLE ONLY redmine.deals_issues ALTER COLUMN id SET DEFAULT nextval('redmine.deals_issues_id_seq'::regclass);
ALTER TABLE ONLY redmine.documents ALTER COLUMN id SET DEFAULT nextval('redmine.documents_id_seq'::regclass);
ALTER TABLE ONLY redmine.email_addresses ALTER COLUMN id SET DEFAULT nextval('redmine.email_addresses_id_seq'::regclass);
ALTER TABLE ONLY redmine.enabled_modules ALTER COLUMN id SET DEFAULT nextval('redmine.enabled_modules_id_seq'::regclass);
ALTER TABLE ONLY redmine.enumerations ALTER COLUMN id SET DEFAULT nextval('redmine.enumerations_id_seq'::regclass);
ALTER TABLE ONLY redmine.favorite_projects ALTER COLUMN id SET DEFAULT nextval('redmine.favorite_projects_id_seq'::regclass);
ALTER TABLE ONLY redmine.helpdesk_mail_rules ALTER COLUMN id SET DEFAULT nextval('redmine.helpdesk_mail_rules_id_seq'::regclass);
ALTER TABLE ONLY redmine.helpdesk_tickets ALTER COLUMN id SET DEFAULT nextval('redmine.helpdesk_tickets_id_seq'::regclass);
ALTER TABLE ONLY redmine.import_items ALTER COLUMN id SET DEFAULT nextval('redmine.import_items_id_seq'::regclass);
ALTER TABLE ONLY redmine.imports ALTER COLUMN id SET DEFAULT nextval('redmine.imports_id_seq'::regclass);
ALTER TABLE ONLY redmine.issue_categories ALTER COLUMN id SET DEFAULT nextval('redmine.issue_categories_id_seq'::regclass);
ALTER TABLE ONLY redmine.issue_relations ALTER COLUMN id SET DEFAULT nextval('redmine.issue_relations_id_seq'::regclass);
ALTER TABLE ONLY redmine.issue_statuses ALTER COLUMN id SET DEFAULT nextval('redmine.issue_statuses_id_seq'::regclass);
ALTER TABLE ONLY redmine.issues ALTER COLUMN id SET DEFAULT nextval('redmine.issues_id_seq'::regclass);
ALTER TABLE ONLY redmine.journal_details ALTER COLUMN id SET DEFAULT nextval('redmine.journal_details_id_seq'::regclass);
ALTER TABLE ONLY redmine.journal_messages ALTER COLUMN id SET DEFAULT nextval('redmine.journal_messages_id_seq'::regclass);
ALTER TABLE ONLY redmine.journals ALTER COLUMN id SET DEFAULT nextval('redmine.journals_id_seq'::regclass);
ALTER TABLE ONLY redmine.member_roles ALTER COLUMN id SET DEFAULT nextval('redmine.member_roles_id_seq'::regclass);
ALTER TABLE ONLY redmine.members ALTER COLUMN id SET DEFAULT nextval('redmine.members_id_seq'::regclass);
ALTER TABLE ONLY redmine.messages ALTER COLUMN id SET DEFAULT nextval('redmine.messages_id_seq'::regclass);
ALTER TABLE ONLY redmine.news ALTER COLUMN id SET DEFAULT nextval('redmine.news_id_seq'::regclass);
ALTER TABLE ONLY redmine.notes ALTER COLUMN id SET DEFAULT nextval('redmine.notes_id_seq'::regclass);
ALTER TABLE ONLY redmine.periodictasks ALTER COLUMN id SET DEFAULT nextval('redmine.periodictasks_id_seq'::regclass);
ALTER TABLE ONLY redmine.projects ALTER COLUMN id SET DEFAULT nextval('redmine.projects_id_seq'::regclass);
ALTER TABLE ONLY redmine.queries ALTER COLUMN id SET DEFAULT nextval('redmine.queries_id_seq'::regclass);
ALTER TABLE ONLY redmine.repositories ALTER COLUMN id SET DEFAULT nextval('redmine.repositories_id_seq'::regclass);
ALTER TABLE ONLY redmine.roles ALTER COLUMN id SET DEFAULT nextval('redmine.roles_id_seq'::regclass);
ALTER TABLE ONLY redmine.settings ALTER COLUMN id SET DEFAULT nextval('redmine.settings_id_seq'::regclass);
ALTER TABLE ONLY redmine.taggings ALTER COLUMN id SET DEFAULT nextval('redmine.taggings_id_seq'::regclass);
ALTER TABLE ONLY redmine.tags ALTER COLUMN id SET DEFAULT nextval('redmine.tags_id_seq'::regclass);
ALTER TABLE ONLY redmine.time_entries ALTER COLUMN id SET DEFAULT nextval('redmine.time_entries_id_seq'::regclass);
ALTER TABLE ONLY redmine.tokens ALTER COLUMN id SET DEFAULT nextval('redmine.tokens_id_seq'::regclass);
ALTER TABLE ONLY redmine.trackers ALTER COLUMN id SET DEFAULT nextval('redmine.trackers_id_seq'::regclass);
ALTER TABLE ONLY redmine.user_preferences ALTER COLUMN id SET DEFAULT nextval('redmine.user_preferences_id_seq'::regclass);
ALTER TABLE ONLY redmine.users ALTER COLUMN id SET DEFAULT nextval('redmine.users_id_seq'::regclass);
ALTER TABLE ONLY redmine.versions ALTER COLUMN id SET DEFAULT nextval('redmine.versions_id_seq'::regclass);
ALTER TABLE ONLY redmine.watchers ALTER COLUMN id SET DEFAULT nextval('redmine.watchers_id_seq'::regclass);
ALTER TABLE ONLY redmine.wiki_content_versions ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_content_versions_id_seq'::regclass);
ALTER TABLE ONLY redmine.wiki_contents ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_contents_id_seq'::regclass);
ALTER TABLE ONLY redmine.wiki_pages ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_pages_id_seq'::regclass);
ALTER TABLE ONLY redmine.wiki_redirects ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_redirects_id_seq'::regclass);
ALTER TABLE ONLY redmine.wikis ALTER COLUMN id SET DEFAULT nextval('redmine.wikis_id_seq'::regclass);
ALTER TABLE ONLY redmine.workflows ALTER COLUMN id SET DEFAULT nextval('redmine.workflows_id_seq'::regclass);
ALTER TABLE ONLY public.sla_cache_spents ADD CONSTRAINT sla_cache_spents_pkey PRIMARY KEY (sla_cache_id, sla_type_id);
ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT sla_caches_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_calendar_holidays ADD CONSTRAINT sla_calendar_holidays_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_calendars ADD CONSTRAINT sla_calendars_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_holidays ADD CONSTRAINT sla_holidays_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_level_terms ADD CONSTRAINT sla_level_terms_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT sla_levels_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT sla_logs_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT sla_project_trackers_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_schedules ADD CONSTRAINT sla_schedules_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT sla_statuses_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.sla_types ADD CONSTRAINT sla_types_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.slas ADD CONSTRAINT slas_pkey PRIMARY KEY (id);
ALTER TABLE ONLY redmine.addresses ADD CONSTRAINT idx_16391_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.agile_colors ADD CONSTRAINT idx_16398_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.agile_data ADD CONSTRAINT idx_16405_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.agile_sprints ADD CONSTRAINT idx_16410_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.ar_internal_metadata ADD CONSTRAINT idx_16418_primary PRIMARY KEY (key);
ALTER TABLE ONLY redmine.attachments ADD CONSTRAINT idx_16424_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.auth_sources ADD CONSTRAINT idx_16438_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.boards ADD CONSTRAINT idx_16450_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.canned_responses ADD CONSTRAINT idx_16460_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.changes ADD CONSTRAINT idx_16467_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.changesets ADD CONSTRAINT idx_16475_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.checklists ADD CONSTRAINT idx_16488_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.checklist_templates ADD CONSTRAINT idx_16498_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.checklist_template_categories ADD CONSTRAINT idx_16506_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.comments ADD CONSTRAINT idx_16512_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.contacts ADD CONSTRAINT idx_16522_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.contacts_queries ADD CONSTRAINT idx_16545_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.custom_fields ADD CONSTRAINT idx_16555_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.custom_field_enumerations ADD CONSTRAINT idx_16586_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.custom_values ADD CONSTRAINT idx_16593_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.deals ADD CONSTRAINT idx_16603_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.deals_issues ADD CONSTRAINT idx_16611_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.deal_categories ADD CONSTRAINT idx_16618_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.deal_processes ADD CONSTRAINT idx_16623_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.deal_statuses ADD CONSTRAINT idx_16628_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.documents ADD CONSTRAINT idx_16641_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.email_addresses ADD CONSTRAINT idx_16651_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.enabled_modules ADD CONSTRAINT idx_16658_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.enumerations ADD CONSTRAINT idx_16663_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.favorite_projects ADD CONSTRAINT idx_16671_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.helpdesk_mail_rules ADD CONSTRAINT idx_16679_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.helpdesk_tickets ADD CONSTRAINT idx_16687_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.imports ADD CONSTRAINT idx_16696_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.import_items ADD CONSTRAINT idx_16704_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.issues ADD CONSTRAINT idx_16711_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.issue_categories ADD CONSTRAINT idx_16722_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.issue_relations ADD CONSTRAINT idx_16729_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.issue_statuses ADD CONSTRAINT idx_16735_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.journals ADD CONSTRAINT idx_16742_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.journal_details ADD CONSTRAINT idx_16753_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.journal_messages ADD CONSTRAINT idx_16763_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.members ADD CONSTRAINT idx_16771_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.member_roles ADD CONSTRAINT idx_16779_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.messages ADD CONSTRAINT idx_16784_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.news ADD CONSTRAINT idx_16795_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.notes ADD CONSTRAINT idx_16806_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.periodictasks ADD CONSTRAINT idx_16827_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.projects ADD CONSTRAINT idx_16835_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.queries ADD CONSTRAINT idx_16852_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.repositories ADD CONSTRAINT idx_16865_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.roles ADD CONSTRAINT idx_16878_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.settings ADD CONSTRAINT idx_16898_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.taggings ADD CONSTRAINT idx_16906_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.tags ADD CONSTRAINT idx_16911_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.time_entries ADD CONSTRAINT idx_16916_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.tokens ADD CONSTRAINT idx_16923_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.trackers ADD CONSTRAINT idx_16931_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.users ADD CONSTRAINT idx_16940_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.user_preferences ADD CONSTRAINT idx_16956_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.versions ADD CONSTRAINT idx_16965_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.watchers ADD CONSTRAINT idx_16977_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.wikis ADD CONSTRAINT idx_16984_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.wiki_contents ADD CONSTRAINT idx_16990_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.wiki_content_versions ADD CONSTRAINT idx_16998_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.wiki_pages ADD CONSTRAINT idx_17007_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.wiki_redirects ADD CONSTRAINT idx_17013_primary PRIMARY KEY (id);
ALTER TABLE ONLY redmine.workflows ADD CONSTRAINT idx_17020_primary PRIMARY KEY (id);
CREATE INDEX index_sla_cache_spents_on_sla_cache_id ON public.sla_cache_spents USING btree (sla_cache_id);
CREATE INDEX index_sla_cache_spents_on_sla_type_id ON public.sla_cache_spents USING btree (sla_type_id);
CREATE INDEX index_sla_caches_on_issue_id ON public.sla_caches USING btree (issue_id);
CREATE INDEX index_sla_caches_on_sla_level_id ON public.sla_caches USING btree (sla_level_id);
CREATE INDEX index_sla_calendar_holidays_on_sla_calendar_id ON public.sla_calendar_holidays USING btree (sla_calendar_id);
CREATE INDEX index_sla_calendar_holidays_on_sla_holiday_id ON public.sla_calendar_holidays USING btree (sla_holiday_id);
CREATE UNIQUE INDEX index_sla_calendars_on_name ON public.sla_calendars USING btree (name);
CREATE UNIQUE INDEX index_sla_holidays_on_date ON public.sla_holidays USING btree (date);
CREATE INDEX index_sla_level_terms_on_sla_level_id ON public.sla_level_terms USING btree (sla_level_id);
CREATE INDEX index_sla_level_terms_on_sla_type_id ON public.sla_level_terms USING btree (sla_type_id);
CREATE UNIQUE INDEX index_sla_levels_on_name ON public.sla_levels USING btree (name);
CREATE INDEX index_sla_levels_on_sla_calendar_id ON public.sla_levels USING btree (sla_calendar_id);
CREATE INDEX index_sla_levels_on_sla_id ON public.sla_levels USING btree (sla_id);
CREATE INDEX index_sla_logs_on_issue_id ON public.sla_logs USING btree (issue_id);
CREATE INDEX index_sla_logs_on_project_id ON public.sla_logs USING btree (project_id);
CREATE INDEX index_sla_logs_on_sla_level_id ON public.sla_logs USING btree (sla_level_id);
CREATE INDEX index_sla_project_trackers_on_project_id ON public.sla_project_trackers USING btree (project_id);
CREATE INDEX index_sla_project_trackers_on_sla_id ON public.sla_project_trackers USING btree (sla_id);
CREATE INDEX index_sla_project_trackers_on_tracker_id ON public.sla_project_trackers USING btree (tracker_id);
CREATE INDEX index_sla_schedules_on_sla_calendar_id ON public.sla_schedules USING btree (sla_calendar_id);
CREATE INDEX index_sla_statuses_on_sla_type_id ON public.sla_statuses USING btree (sla_type_id);
CREATE INDEX index_sla_statuses_on_status_id ON public.sla_statuses USING btree (status_id);
CREATE UNIQUE INDEX index_sla_types_on_name ON public.sla_types USING btree (name);
CREATE UNIQUE INDEX index_slas_on_name ON public.slas USING btree (name);
CREATE UNIQUE INDEX sla_cache_issue_level_ukey ON public.sla_caches USING btree (issue_id, sla_level_id);
CREATE UNIQUE INDEX sla_cache_issue_ukey ON public.sla_caches USING btree (issue_id);
CREATE UNIQUE INDEX sla_calendar_holidays_ukey ON public.sla_calendar_holidays USING btree (sla_calendar_id, sla_holiday_id);
CREATE UNIQUE INDEX sla_level_terms_ukey ON public.sla_level_terms USING btree (sla_level_id, sla_type_id, priority_id);
CREATE UNIQUE INDEX sla_project_trackers_ukey ON public.sla_project_trackers USING btree (project_id, tracker_id);
CREATE UNIQUE INDEX sla_schedules_ukey ON public.sla_schedules USING btree (sla_calendar_id, dow, start_time, end_time);
CREATE UNIQUE INDEX sla_statuses_ukey ON public.sla_statuses USING btree (status_id, sla_type_id);
CREATE INDEX custom_values_customized_custom_field ON redmine.custom_values USING btree (customized_type, customized_id, custom_field_id);
CREATE INDEX idx_16391_index_addresses_on_address_type ON redmine.addresses USING btree (address_type);
CREATE INDEX idx_16391_index_addresses_on_addressable_id_and_addressable_typ ON redmine.addresses USING btree (addressable_id, addressable_type);
CREATE INDEX idx_16398_index_agile_colors_on_container_id ON redmine.agile_colors USING btree (container_id);
CREATE INDEX idx_16398_index_agile_colors_on_container_type ON redmine.agile_colors USING btree (container_type);
CREATE INDEX idx_16405_index_agile_data_on_issue_id ON redmine.agile_data USING btree (issue_id);
CREATE INDEX idx_16405_index_agile_data_on_position ON redmine.agile_data USING btree ("position");
CREATE INDEX idx_16424_index_attachments_on_author_id ON redmine.attachments USING btree (author_id);
CREATE INDEX idx_16424_index_attachments_on_container_id_and_container_type ON redmine.attachments USING btree (container_id, container_type);
CREATE INDEX idx_16424_index_attachments_on_created_on ON redmine.attachments USING btree (created_on);
CREATE INDEX idx_16424_index_attachments_on_disk_filename ON redmine.attachments USING btree (disk_filename);
CREATE INDEX idx_16438_index_auth_sources_on_id_and_type ON redmine.auth_sources USING btree (id, type);
CREATE INDEX idx_16450_boards_project_id ON redmine.boards USING btree (project_id);
CREATE INDEX idx_16450_index_boards_on_last_message_id ON redmine.boards USING btree (last_message_id);
CREATE INDEX idx_16467_changesets_changeset_id ON redmine.changes USING btree (changeset_id);
CREATE UNIQUE INDEX idx_16475_changesets_repos_rev ON redmine.changesets USING btree (repository_id, revision);
CREATE INDEX idx_16475_changesets_repos_scmid ON redmine.changesets USING btree (repository_id, scmid);
CREATE INDEX idx_16475_index_changesets_on_committed_on ON redmine.changesets USING btree (committed_on);
CREATE INDEX idx_16475_index_changesets_on_repository_id ON redmine.changesets USING btree (repository_id);
CREATE INDEX idx_16475_index_changesets_on_user_id ON redmine.changesets USING btree (user_id);
CREATE UNIQUE INDEX idx_16481_changesets_issues_ids ON redmine.changesets_issues USING btree (changeset_id, issue_id);
CREATE INDEX idx_16481_index_changesets_issues_on_issue_id ON redmine.changesets_issues USING btree (issue_id);
CREATE INDEX idx_16484_changeset_parents_changeset_ids ON redmine.changeset_parents USING btree (changeset_id);
CREATE INDEX idx_16484_changeset_parents_parent_ids ON redmine.changeset_parents USING btree (parent_id);
CREATE INDEX idx_16498_index_checklist_templates_on_tracker_id ON redmine.checklist_templates USING btree (tracker_id);
CREATE INDEX idx_16512_index_comments_on_author_id ON redmine.comments USING btree (author_id);
CREATE INDEX idx_16512_index_comments_on_commented_id_and_commented_type ON redmine.comments USING btree (commented_id, commented_type);
CREATE INDEX idx_16522_index_contacts_on_assigned_to_id ON redmine.contacts USING btree (assigned_to_id);
CREATE INDEX idx_16522_index_contacts_on_author_id ON redmine.contacts USING btree (author_id);
CREATE INDEX idx_16522_index_contacts_on_company ON redmine.contacts USING btree (company);
CREATE INDEX idx_16522_index_contacts_on_email ON redmine.contacts USING btree (email);
CREATE INDEX idx_16522_index_contacts_on_first_name ON redmine.contacts USING btree (first_name);
CREATE INDEX idx_16522_index_contacts_on_is_company ON redmine.contacts USING btree (is_company);
CREATE INDEX idx_16531_index_contacts_deals_on_contact_id ON redmine.contacts_deals USING btree (contact_id);
CREATE INDEX idx_16531_index_contacts_deals_on_deal_id ON redmine.contacts_deals USING btree (deal_id);
CREATE INDEX idx_16534_index_contacts_issues_on_contact_id ON redmine.contacts_issues USING btree (contact_id);
CREATE INDEX idx_16534_index_contacts_issues_on_issue_id ON redmine.contacts_issues USING btree (issue_id);
CREATE INDEX idx_16539_index_contacts_projects_on_contact_id ON redmine.contacts_projects USING btree (contact_id);
CREATE INDEX idx_16539_index_contacts_projects_on_project_id ON redmine.contacts_projects USING btree (project_id);
CREATE INDEX idx_16545_index_contacts_queries_on_project_id ON redmine.contacts_queries USING btree (project_id);
CREATE INDEX idx_16545_index_contacts_queries_on_user_id ON redmine.contacts_queries USING btree (user_id);
CREATE INDEX idx_16555_index_custom_fields_on_id_and_type ON redmine.custom_fields USING btree (id, type);
CREATE UNIQUE INDEX idx_16572_index_custom_fields_projects_on_custom_field_id_and_p ON redmine.custom_fields_projects USING btree (custom_field_id, project_id);
CREATE UNIQUE INDEX idx_16577_custom_fields_roles_ids ON redmine.custom_fields_roles USING btree (custom_field_id, role_id);
CREATE UNIQUE INDEX idx_16580_index_custom_fields_trackers_on_custom_field_id_and_t ON redmine.custom_fields_trackers USING btree (custom_field_id, tracker_id);
CREATE INDEX idx_16593_custom_values_customized ON redmine.custom_values USING btree (customized_type, customized_id);
CREATE INDEX idx_16593_index_custom_values_on_custom_field_id ON redmine.custom_values USING btree (custom_field_id);
CREATE INDEX idx_16603_index_deals_on_author_id ON redmine.deals USING btree (author_id);
CREATE INDEX idx_16603_index_deals_on_category_id ON redmine.deals USING btree (category_id);
CREATE INDEX idx_16603_index_deals_on_contact_id ON redmine.deals USING btree (contact_id);
CREATE INDEX idx_16603_index_deals_on_project_id ON redmine.deals USING btree (project_id);
CREATE INDEX idx_16603_index_deals_on_status_id ON redmine.deals USING btree (status_id);
CREATE INDEX idx_16611_index_deals_issues_on_deal_id ON redmine.deals_issues USING btree (deal_id);
CREATE INDEX idx_16611_index_deals_issues_on_issue_id ON redmine.deals_issues USING btree (issue_id);
CREATE INDEX idx_16618_index_deal_categories_on_project_id ON redmine.deal_categories USING btree (project_id);
CREATE INDEX idx_16623_index_deal_processes_on_author_id ON redmine.deal_processes USING btree (author_id);
CREATE INDEX idx_16623_index_deal_processes_on_deal_id ON redmine.deal_processes USING btree (deal_id);
CREATE INDEX idx_16635_index_deal_statuses_projects_on_project_id_and_deal_s ON redmine.deal_statuses_projects USING btree (project_id, deal_status_id);
CREATE INDEX idx_16641_documents_project_id ON redmine.documents USING btree (project_id);
CREATE INDEX idx_16641_index_documents_on_category_id ON redmine.documents USING btree (category_id);
CREATE INDEX idx_16641_index_documents_on_created_on ON redmine.documents USING btree (created_on);
CREATE INDEX idx_16651_index_email_addresses_on_user_id ON redmine.email_addresses USING btree (user_id);
CREATE INDEX idx_16658_enabled_modules_project_id ON redmine.enabled_modules USING btree (project_id);
CREATE INDEX idx_16663_index_enumerations_on_id_and_type ON redmine.enumerations USING btree (id, type);
CREATE INDEX idx_16663_index_enumerations_on_project_id ON redmine.enumerations USING btree (project_id);
CREATE UNIQUE INDEX idx_16675_groups_users_ids ON redmine.groups_users USING btree (group_id, user_id);
CREATE INDEX idx_16687_index_helpdesk_tickets_on_issue_id_and_contact_id ON redmine.helpdesk_tickets USING btree (issue_id, contact_id);
CREATE INDEX idx_16687_index_helpdesk_tickets_on_message_id ON redmine.helpdesk_tickets USING btree (message_id);
CREATE INDEX idx_16711_index_issues_on_assigned_to_id ON redmine.issues USING btree (assigned_to_id);
CREATE INDEX idx_16711_index_issues_on_author_id ON redmine.issues USING btree (author_id);
CREATE INDEX idx_16711_index_issues_on_category_id ON redmine.issues USING btree (category_id);
CREATE INDEX idx_16711_index_issues_on_created_on ON redmine.issues USING btree (created_on);
CREATE INDEX idx_16711_index_issues_on_fixed_version_id ON redmine.issues USING btree (fixed_version_id);
CREATE INDEX idx_16711_index_issues_on_parent_id ON redmine.issues USING btree (parent_id);
CREATE INDEX idx_16711_index_issues_on_priority_id ON redmine.issues USING btree (priority_id);
CREATE INDEX idx_16711_index_issues_on_root_id_and_lft_and_rgt ON redmine.issues USING btree (root_id, lft, rgt);
CREATE INDEX idx_16711_index_issues_on_status_id ON redmine.issues USING btree (status_id);
CREATE INDEX idx_16711_index_issues_on_tracker_id ON redmine.issues USING btree (tracker_id);
CREATE INDEX idx_16711_issues_project_id ON redmine.issues USING btree (project_id);
CREATE INDEX idx_16722_index_issue_categories_on_assigned_to_id ON redmine.issue_categories USING btree (assigned_to_id);
CREATE INDEX idx_16722_issue_categories_project_id ON redmine.issue_categories USING btree (project_id);
CREATE INDEX idx_16729_index_issue_relations_on_issue_from_id ON redmine.issue_relations USING btree (issue_from_id);
CREATE UNIQUE INDEX idx_16729_index_issue_relations_on_issue_from_id_and_issue_to_i ON redmine.issue_relations USING btree (issue_from_id, issue_to_id);
CREATE INDEX idx_16729_index_issue_relations_on_issue_to_id ON redmine.issue_relations USING btree (issue_to_id);
CREATE INDEX idx_16735_index_issue_statuses_on_is_closed ON redmine.issue_statuses USING btree (is_closed);
CREATE INDEX idx_16735_index_issue_statuses_on_position ON redmine.issue_statuses USING btree ("position");
CREATE INDEX idx_16742_index_journals_on_created_on ON redmine.journals USING btree (created_on);
CREATE INDEX idx_16742_index_journals_on_journalized_id ON redmine.journals USING btree (journalized_id);
CREATE INDEX idx_16742_index_journals_on_user_id ON redmine.journals USING btree (user_id);
CREATE INDEX idx_16742_journals_journalized_id ON redmine.journals USING btree (journalized_id, journalized_type);
CREATE INDEX idx_16753_journal_details_journal_id ON redmine.journal_details USING btree (journal_id);
CREATE INDEX idx_16763_index_journal_messages_on_journal_id_and_contact_id ON redmine.journal_messages USING btree (journal_id, contact_id);
CREATE INDEX idx_16763_index_journal_messages_on_message_id ON redmine.journal_messages USING btree (message_id);
CREATE INDEX idx_16771_index_members_on_project_id ON redmine.members USING btree (project_id);
CREATE INDEX idx_16771_index_members_on_user_id ON redmine.members USING btree (user_id);
CREATE UNIQUE INDEX idx_16771_index_members_on_user_id_and_project_id ON redmine.members USING btree (user_id, project_id);
CREATE INDEX idx_16779_index_member_roles_on_inherited_from ON redmine.member_roles USING btree (inherited_from);
CREATE INDEX idx_16779_index_member_roles_on_member_id ON redmine.member_roles USING btree (member_id);
CREATE INDEX idx_16779_index_member_roles_on_role_id ON redmine.member_roles USING btree (role_id);
CREATE INDEX idx_16784_index_messages_on_author_id ON redmine.messages USING btree (author_id);
CREATE INDEX idx_16784_index_messages_on_created_on ON redmine.messages USING btree (created_on);
CREATE INDEX idx_16784_index_messages_on_last_reply_id ON redmine.messages USING btree (last_reply_id);
CREATE INDEX idx_16784_messages_board_id ON redmine.messages USING btree (board_id);
CREATE INDEX idx_16784_messages_parent_id ON redmine.messages USING btree (parent_id);
CREATE INDEX idx_16795_index_news_on_author_id ON redmine.news USING btree (author_id);
CREATE INDEX idx_16795_index_news_on_created_on ON redmine.news USING btree (created_on);
CREATE INDEX idx_16795_news_project_id ON redmine.news USING btree (project_id);
CREATE INDEX idx_16806_index_notes_on_author_id ON redmine.notes USING btree (author_id);
CREATE INDEX idx_16806_index_notes_on_source_id_and_source_type ON redmine.notes USING btree (source_id, source_type);
CREATE INDEX idx_16806_index_notes_on_type_id ON redmine.notes USING btree (type_id);
CREATE INDEX idx_16835_index_projects_on_lft ON redmine.projects USING btree (lft);
CREATE INDEX idx_16835_index_projects_on_rgt ON redmine.projects USING btree (rgt);
CREATE INDEX idx_16846_projects_trackers_project_id ON redmine.projects_trackers USING btree (project_id);
CREATE UNIQUE INDEX idx_16846_projects_trackers_unique ON redmine.projects_trackers USING btree (project_id, tracker_id);
CREATE INDEX idx_16852_index_queries_on_project_id ON redmine.queries USING btree (project_id);
CREATE INDEX idx_16852_index_queries_on_user_id ON redmine.queries USING btree (user_id);
CREATE UNIQUE INDEX idx_16861_queries_roles_ids ON redmine.queries_roles USING btree (query_id, role_id);
CREATE INDEX idx_16865_index_repositories_on_project_id ON redmine.repositories USING btree (project_id);
CREATE UNIQUE INDEX idx_16891_index_roles_managed_roles_on_role_id_and_managed_role ON redmine.roles_managed_roles USING btree (role_id, managed_role_id);
CREATE UNIQUE INDEX idx_16894_unique_schema_migrations ON redmine.schema_migrations USING btree (version);
CREATE INDEX idx_16898_index_settings_on_name ON redmine.settings USING btree (name);
CREATE INDEX idx_16906_index_taggings_on_tag_id ON redmine.taggings USING btree (tag_id);
CREATE INDEX idx_16906_index_taggings_on_taggable_id_and_taggable_type ON redmine.taggings USING btree (taggable_id, taggable_type);
CREATE INDEX idx_16916_index_time_entries_on_activity_id ON redmine.time_entries USING btree (activity_id);
CREATE INDEX idx_16916_index_time_entries_on_created_on ON redmine.time_entries USING btree (created_on);
CREATE INDEX idx_16916_index_time_entries_on_user_id ON redmine.time_entries USING btree (user_id);
CREATE INDEX idx_16916_time_entries_issue_id ON redmine.time_entries USING btree (issue_id);
CREATE INDEX idx_16916_time_entries_project_id ON redmine.time_entries USING btree (project_id);
CREATE INDEX idx_16923_index_tokens_on_user_id ON redmine.tokens USING btree (user_id);
CREATE UNIQUE INDEX idx_16923_tokens_value ON redmine.tokens USING btree (value);
CREATE INDEX idx_16940_index_users_on_auth_source_id ON redmine.users USING btree (auth_source_id);
CREATE INDEX idx_16940_index_users_on_id_and_type ON redmine.users USING btree (id, type);
CREATE INDEX idx_16940_index_users_on_type ON redmine.users USING btree (type);
CREATE INDEX idx_16956_index_user_preferences_on_user_id ON redmine.user_preferences USING btree (user_id);
CREATE INDEX idx_16965_index_versions_on_sharing ON redmine.versions USING btree (sharing);
CREATE INDEX idx_16965_versions_project_id ON redmine.versions USING btree (project_id);
CREATE INDEX idx_16977_index_watchers_on_user_id ON redmine.watchers USING btree (user_id);
CREATE INDEX idx_16977_index_watchers_on_watchable_id_and_watchable_type ON redmine.watchers USING btree (watchable_id, watchable_type);
CREATE INDEX idx_16977_watchers_user_id_type ON redmine.watchers USING btree (user_id, watchable_type);
CREATE INDEX idx_16984_wikis_project_id ON redmine.wikis USING btree (project_id);
CREATE INDEX idx_16990_index_wiki_contents_on_author_id ON redmine.wiki_contents USING btree (author_id);
CREATE INDEX idx_16990_wiki_contents_page_id ON redmine.wiki_contents USING btree (page_id);
CREATE INDEX idx_16998_index_wiki_content_versions_on_updated_on ON redmine.wiki_content_versions USING btree (updated_on);
CREATE INDEX idx_16998_wiki_content_versions_wcid ON redmine.wiki_content_versions USING btree (wiki_content_id);
CREATE INDEX idx_17007_index_wiki_pages_on_parent_id ON redmine.wiki_pages USING btree (parent_id);
CREATE INDEX idx_17007_index_wiki_pages_on_wiki_id ON redmine.wiki_pages USING btree (wiki_id);
CREATE INDEX idx_17007_wiki_pages_wiki_id_title ON redmine.wiki_pages USING btree (wiki_id, title);
CREATE INDEX idx_17013_index_wiki_redirects_on_wiki_id ON redmine.wiki_redirects USING btree (wiki_id);
CREATE INDEX idx_17013_wiki_redirects_wiki_id_title ON redmine.wiki_redirects USING btree (wiki_id, title);
CREATE INDEX idx_17020_index_workflows_on_new_status_id ON redmine.workflows USING btree (new_status_id);
CREATE INDEX idx_17020_index_workflows_on_old_status_id ON redmine.workflows USING btree (old_status_id);
CREATE INDEX idx_17020_index_workflows_on_role_id ON redmine.workflows USING btree (role_id);
CREATE INDEX idx_17020_index_workflows_on_tracker_id ON redmine.workflows USING btree (tracker_id);
CREATE INDEX idx_17020_wkfs_role_tracker_old_status ON redmine.workflows USING btree (role_id, tracker_id, old_status_id);
CREATE INDEX index_import_items_on_import_id_and_unique_id ON redmine.import_items USING btree (import_id, unique_id);
ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_0c39d09223 FOREIGN KEY (sla_id) REFERENCES public.slas(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT fk_rails_11cf1a945c FOREIGN KEY (sla_calendar_id) REFERENCES public.sla_calendars(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT fk_rails_16874bf5c3 FOREIGN KEY (sla_level_id) REFERENCES public.sla_levels(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT fk_rails_362572edd0 FOREIGN KEY (issue_id) REFERENCES redmine.issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_schedules ADD CONSTRAINT fk_rails_42761b6131 FOREIGN KEY (sla_calendar_id) REFERENCES public.sla_calendars(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT fk_rails_4493143516 FOREIGN KEY (status_id) REFERENCES redmine.issue_statuses(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_cache_spents ADD CONSTRAINT fk_rails_4b64c2b9dd FOREIGN KEY (sla_type_id) REFERENCES public.sla_types(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_574e6fb859 FOREIGN KEY (sla_level_id) REFERENCES public.sla_levels(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_calendar_holidays ADD CONSTRAINT fk_rails_884a921bf9 FOREIGN KEY (sla_holiday_id) REFERENCES public.sla_holidays(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_95254dedd5 FOREIGN KEY (project_id) REFERENCES redmine.projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT fk_rails_9a557abf1b FOREIGN KEY (sla_id) REFERENCES public.slas(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_cache_spents ADD CONSTRAINT fk_rails_9cd56ac0f1 FOREIGN KEY (sla_cache_id) REFERENCES public.sla_caches(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT fk_rails_a27f9e47d0 FOREIGN KEY (sla_type_id) REFERENCES public.sla_types(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_calendar_holidays ADD CONSTRAINT fk_rails_dd490be0af FOREIGN KEY (sla_calendar_id) REFERENCES public.sla_calendars(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_ec396598c2 FOREIGN KEY (issue_id) REFERENCES redmine.issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_level_terms ADD CONSTRAINT fk_rails_ef6d7419c6 FOREIGN KEY (sla_level_id) REFERENCES public.sla_levels(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_f75f2aa0c6 FOREIGN KEY (project_id) REFERENCES redmine.projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_level_terms ADD CONSTRAINT fk_rails_f83416cf83 FOREIGN KEY (sla_type_id) REFERENCES public.sla_types(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_fdecde5316 FOREIGN KEY (tracker_id) REFERENCES redmine.trackers(id) ON DELETE CASCADE;
`
I understand that the "sla_get_date" function expects a "timestamp without time zone" :
CREATE FUNCTION redmine.sla_get_date(p_date timestamp without time zone) RETURNS timestamp without time zone
and it receives a "timestamp with time zone" :
sla_get_date(timestamp with time zone) does not exist
According to the call, this means that a "timestamp with time zone" is used :
sla_get_date( "issues"."created_on" )
and indeed on your installation we have this definition :
created_on timestamp with time zone
when it should be this definition :
created_on timestamp with time zone
Can you see to fit this type when importing with pgloader ?
Personally, I use this configuration file to switch Redmine from MySQL to PostgreSQL. redmine_migration.txt
@likehopper
Thank you for your help and for responding promptly. Unfortunately, we are discontinuing the installation of the plugin. In our company, we plan to first upgrade to Redmine version 5.0 before further addressing the plugin.
After i created a new Issue with the plugin active i get the following error message
It is running on Docker, the database is from mysql imported with
pgloader mysql://root:xxx123@localhost/redmine postgresql://postgres:xxx123@localhost/redmine
I checked, the data and the functions are there, maybe the are called wrong, because all my date life in the "redmine" db?
Is the Databasename "redmine" the issue here? The scheme of the slaget funtions is public.
redmine-test-v5_0_7-redmine-1 | I, [2023-12-22T17:25:07.782310 #1] INFO -- : Rendered issues/show.html.erb within layouts/base (Duration: 10.7ms | Allocations: 9303) redmine-test-v5_0_7-redmine-1 | I, [2023-12-22T17:25:07.782522 #1] INFO -- : Rendered layout layouts/base.html.erb (Duration: 11.0ms | Allocations: 9332) redmine-test-v5_0_7-redmine-1 | I, [2023-12-22T17:25:07.782827 #1] INFO -- : Completed 500 Internal Server Error in 40ms (ActiveRecord: 14.0ms | Allocations: 29058) redmine-test-v5_0_7-redmine-1 |F, [2023-12-22T17:25:07.783592 #1] FATAL -- : redmine-test-v5_0_7-redmine-1 | ActionView::Template::Error (PG::UndefinedFunction: ERROR: function sla_get_date(timestamp with time zone) does not exist redmine-test-v5_0_7-redmine-1 |LINE 2: sla_get_date( "issues"."created_on" ), redmine-test-v5_0_7-redmine-1 | ^ redmine-test-v5_0_7-redmine-1 |HINT: No function matches the given name and argument types. You might need to add explicit type casts. redmine-test-v5_0_7-redmine-1 |QUERY: SELECT redmine-test-v5_0_7-redmine-1 | sla_get_date( "issues"."created_on" ), redmine-test-v5_0_7-redmine-1 | tracker_id, redmine-test-v5_0_7-redmine-1 | project_id redmine-test-v5_0_7-redmine-1 | FROM redmine-test-v5_0_7-redmine-1 | issues redmine-test-v5_0_7-redmine-1 | WHERE redmine-test-v5_0_7-redmine-1 | id = p_issue_id redmine-test-v5_0_7-redmine-1 | CONTEXT: PL/pgSQL function sla_get_level(integer) line 39 at SQL statement redmine-test-v5_0_7-redmine-1 | ): redmine-test-v5_0_7-redmine-1 | 1: <% redmine-test-v5_0_7-redmine-1 | 2: if User.current.allowed_to?(:view_sla, @project, :global => true) redmine-test-v5_0_7-redmine-1 | 3: redmine-test-v5_0_7-redmine-1 | 4: sla_cache = SlaCache.find_or_new(issue.id) redmine-test-v5_0_7-redmine-1 | 5: redmine-test-v5_0_7-redmine-1 | 6: if ( !sla_cache.nil? && sla_cache.sla_level_id > 0 ) redmine-test-v5_0_7-redmine-1 | 7: redmine-test-v5_0_7-redmine-1 | redmine-test-v5_0_7-redmine-1 |plugins/redmine_sla/app/models/sla_cache.rb:40:in
find_or_new' redmine-test-v5_0_7-redmine-1 |plugins/redmine_sla/app/views/sla_issue_helper/_show.html.erb:4 redmine-test-v5_0_7-redmine-1 | lib/redmine/hook/view_listener.rb:61:in
block (2 levels) in render_on' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook/view_listener.rb:59:inmap' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook/view_listener.rb:59:in
block in render_on' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:inblock (2 levels) in call_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:in
each' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:inblock in call_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:63:in
call_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:101:incall_hook' redmine-test-v5_0_7-redmine-1 | app/views/issues/show.html.erb:81 redmine-test-v5_0_7-redmine-1 | app/controllers/issues_controller.rb:118:in
block (2 levels) in show' redmine-test-v5_0_7-redmine-1 | app/controllers/issues_controller.rb:110:inshow' redmine-test-v5_0_7-redmine-1 | lib/redmine/sudo_mode.rb:61:in
sudo_mode'