likehopper / redmine_sla

Manage SLAs in Redmine!
GNU General Public License v2.0
10 stars 3 forks source link

ActionView::Template::Error (PG::UndefinedFunction: ERROR: function sla_get_date(timestamp with time zone) does not exist #11

Closed opino closed 10 months ago

opino commented 11 months ago

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:inblock (2 levels) in render_on' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook/view_listener.rb:59:in map' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook/view_listener.rb:59:inblock in render_on' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:in block (2 levels) in call_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:ineach' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:66:in block in call_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:63:incall_hook' redmine-test-v5_0_7-redmine-1 | lib/redmine/hook.rb:101:in call_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:inblock (2 levels) in show' redmine-test-v5_0_7-redmine-1 | app/controllers/issues_controller.rb:110:in show' redmine-test-v5_0_7-redmine-1 | lib/redmine/sudo_mode.rb:61:insudo_mode'

likehopper commented 11 months ago
  1. Does your Redmine work well under Postgres without the plugin?
  2. What is your version of Postgres? Because from version 9, the Pl/PgSQL language is installed by default. Otherwise, have you installed the Pl/Pgsql procedural language in Postgres? ( you can test with a query like this « SELECT EXISTS ( SELECT 1 FROM pg_language WHERE lanname = 'plpgsql'); » )
  3. If it still doesn't work, could you give me just the schema of your database? ( with --schema-only pg_dump option )
opino commented 10 months ago

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)
opino commented 10 months ago

`-- -- PostgreSQL database dump

-- 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;

-- -- Name: redmine; Type: SCHEMA; Schema: -; Owner: postgres

CREATE SCHEMA redmine;

ALTER SCHEMA redmine OWNER TO postgres;

-- -- Name: sla_log_level; Type: TYPE; Schema: public; Owner: 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;

-- -- Name: sla_get_date(timestamp without time zone); Type: FUNCTION; Schema: redmine; Owner: 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;

-- -- Name: sla_caches; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_get_level(integer); Type: FUNCTION; Schema: redmine; Owner: 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;

-- -- Name: sla_cache_spents; Type: TABLE; Schema: public; Owner: 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;

-- -- Name: sla_get_spent(integer, integer); Type: FUNCTION; Schema: redmine; Owner: 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;

-- -- Name: sla_caches_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_caches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_caches_id_seq OWNED BY public.sla_caches.id;

-- -- Name: sla_calendar_holidays; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_calendar_holidays_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_calendar_holidays_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_calendar_holidays_id_seq OWNED BY public.sla_calendar_holidays.id;

-- -- Name: sla_calendars; Type: TABLE; Schema: public; Owner: postgres

CREATE TABLE public.sla_calendars ( id bigint NOT NULL, name text NOT NULL );

ALTER TABLE public.sla_calendars OWNER TO postgres;

-- -- Name: sla_calendars_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_calendars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_calendars_id_seq OWNED BY public.sla_calendars.id;

-- -- Name: sla_holidays; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_holidays_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_holidays_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_holidays_id_seq OWNED BY public.sla_holidays.id;

-- -- Name: sla_level_terms; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_level_terms_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_level_terms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_level_terms_id_seq OWNED BY public.sla_level_terms.id;

-- -- Name: sla_levels; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_levels_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_levels_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_levels_id_seq OWNED BY public.sla_levels.id;

-- -- Name: sla_logs; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_logs_id_seq OWNED BY public.sla_logs.id;

-- -- Name: sla_project_trackers; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_project_trackers_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_project_trackers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_project_trackers_id_seq OWNED BY public.sla_project_trackers.id;

-- -- Name: sla_schedules; Type: TABLE; Schema: public; Owner: postgres

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;

-- -- Name: sla_schedules_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_schedules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_schedules_id_seq OWNED BY public.sla_schedules.id;

-- -- Name: sla_statuses; Type: TABLE; Schema: public; Owner: postgres

CREATE TABLE public.sla_statuses ( id bigint NOT NULL, status_id bigint, sla_type_id bigint );

ALTER TABLE public.sla_statuses OWNER TO postgres;

-- -- Name: sla_statuses_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_statuses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_statuses_id_seq OWNED BY public.sla_statuses.id;

-- -- Name: sla_types; Type: TABLE; Schema: public; Owner: postgres

CREATE TABLE public.sla_types ( id bigint NOT NULL, name text NOT NULL );

ALTER TABLE public.sla_types OWNER TO postgres;

-- -- Name: sla_types_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: sla_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.sla_types_id_seq OWNED BY public.sla_types.id;

-- -- Name: issues; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: journal_details; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: journals; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: sla_view_journal_statuses; Type: VIEW; Schema: public; Owner: 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;

-- -- Name: sla_view_roll_statuses; Type: VIEW; Schema: public; Owner: 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;

-- -- Name: slas; Type: TABLE; Schema: public; Owner: postgres

CREATE TABLE public.slas ( id bigint NOT NULL, name text NOT NULL );

ALTER TABLE public.slas OWNER TO postgres;

-- -- Name: slas_id_seq; Type: SEQUENCE; Schema: public; Owner: 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;

-- -- Name: slas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres

ALTER SEQUENCE public.slas_id_seq OWNED BY public.slas.id;

-- -- Name: addresses; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: addresses_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.addresses_id_seq OWNED BY redmine.addresses.id;

-- -- Name: agile_colors; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: agile_colors_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: agile_colors_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.agile_colors_id_seq OWNED BY redmine.agile_colors.id;

-- -- Name: agile_data; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: agile_data_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: agile_data_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.agile_data_id_seq OWNED BY redmine.agile_data.id;

-- -- Name: agile_sprints; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: agile_sprints_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: agile_sprints_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.agile_sprints_id_seq OWNED BY redmine.agile_sprints.id;

-- -- Name: ar_internal_metadata; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: attachments; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: attachments_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.attachments_id_seq OWNED BY redmine.attachments.id;

-- -- Name: auth_sources; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: auth_sources_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: auth_sources_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.auth_sources_id_seq OWNED BY redmine.auth_sources.id;

-- -- Name: boards; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: boards_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: boards_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.boards_id_seq OWNED BY redmine.boards.id;

-- -- Name: canned_responses; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: canned_responses_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: canned_responses_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.canned_responses_id_seq OWNED BY redmine.canned_responses.id;

-- -- Name: changes; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: changes_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: changes_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.changes_id_seq OWNED BY redmine.changes.id;

-- -- Name: changeset_parents; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.changeset_parents ( changeset_id bigint NOT NULL, parent_id bigint NOT NULL );

ALTER TABLE redmine.changeset_parents OWNER TO postgres;

-- -- Name: changesets; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: changesets_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: changesets_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.changesets_id_seq OWNED BY redmine.changesets.id;

-- -- Name: changesets_issues; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.changesets_issues ( changeset_id bigint NOT NULL, issue_id bigint NOT NULL );

ALTER TABLE redmine.changesets_issues OWNER TO postgres;

-- -- Name: checklist_template_categories; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: checklist_template_categories_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: checklist_template_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.checklist_template_categories_id_seq OWNED BY redmine.checklist_template_categories.id;

-- -- Name: checklist_templates; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: checklist_templates_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: checklist_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.checklist_templates_id_seq OWNED BY redmine.checklist_templates.id;

-- -- Name: checklists; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: checklists_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: checklists_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.checklists_id_seq OWNED BY redmine.checklists.id;

-- -- Name: comments; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: comments_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.comments_id_seq OWNED BY redmine.comments.id;

-- -- Name: contacts; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: contacts_deals; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.contacts_deals ( deal_id bigint, contact_id bigint );

ALTER TABLE redmine.contacts_deals OWNER TO postgres;

-- -- Name: contacts_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.contacts_id_seq OWNED BY redmine.contacts.id;

-- -- Name: contacts_issues; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: contacts_projects; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: contacts_queries; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: contacts_queries_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: contacts_queries_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.contacts_queries_id_seq OWNED BY redmine.contacts_queries.id;

-- -- Name: custom_field_enumerations; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: custom_field_enumerations_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: custom_field_enumerations_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.custom_field_enumerations_id_seq OWNED BY redmine.custom_field_enumerations.id;

-- -- Name: custom_fields; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: custom_fields_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: custom_fields_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.custom_fields_id_seq OWNED BY redmine.custom_fields.id;

-- -- Name: custom_fields_projects; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: custom_fields_roles; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: custom_fields_trackers; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: custom_values; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: custom_values_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: custom_values_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.custom_values_id_seq OWNED BY redmine.custom_values.id;

-- -- Name: deal_categories; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: deal_categories_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: deal_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.deal_categories_id_seq OWNED BY redmine.deal_categories.id;

-- -- Name: deal_processes; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: deal_processes_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: deal_processes_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.deal_processes_id_seq OWNED BY redmine.deal_processes.id;

-- -- Name: deal_statuses; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: deal_statuses_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: deal_statuses_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.deal_statuses_id_seq OWNED BY redmine.deal_statuses.id;

-- -- Name: deal_statuses_projects; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: deals; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: deals_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: deals_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.deals_id_seq OWNED BY redmine.deals.id;

-- -- Name: deals_issues; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: deals_issues_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: deals_issues_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.deals_issues_id_seq OWNED BY redmine.deals_issues.id;

-- -- Name: documents; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: documents_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: documents_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.documents_id_seq OWNED BY redmine.documents.id;

-- -- Name: email_addresses; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: email_addresses_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: email_addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.email_addresses_id_seq OWNED BY redmine.email_addresses.id;

-- -- Name: enabled_modules; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: enabled_modules_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: enabled_modules_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.enabled_modules_id_seq OWNED BY redmine.enabled_modules.id;

-- -- Name: enumerations; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: enumerations_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: enumerations_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.enumerations_id_seq OWNED BY redmine.enumerations.id;

-- -- Name: favorite_projects; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.favorite_projects ( id bigint NOT NULL, user_id bigint, project_id bigint );

ALTER TABLE redmine.favorite_projects OWNER TO postgres;

-- -- Name: favorite_projects_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: favorite_projects_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.favorite_projects_id_seq OWNED BY redmine.favorite_projects.id;

-- -- Name: groups_users; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.groups_users ( group_id bigint NOT NULL, user_id bigint NOT NULL );

ALTER TABLE redmine.groups_users OWNER TO postgres;

-- -- Name: helpdesk_mail_rules; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: helpdesk_mail_rules_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: helpdesk_mail_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.helpdesk_mail_rules_id_seq OWNED BY redmine.helpdesk_mail_rules.id;

-- -- Name: helpdesk_tickets; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: helpdesk_tickets_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: helpdesk_tickets_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.helpdesk_tickets_id_seq OWNED BY redmine.helpdesk_tickets.id;

-- -- Name: import_items; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: import_items_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: import_items_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.import_items_id_seq OWNED BY redmine.import_items.id;

-- -- Name: imports; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: imports_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: imports_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.imports_id_seq OWNED BY redmine.imports.id;

-- -- Name: issue_categories; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: issue_categories_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: issue_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.issue_categories_id_seq OWNED BY redmine.issue_categories.id;

-- -- Name: issue_relations; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: issue_relations_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: issue_relations_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.issue_relations_id_seq OWNED BY redmine.issue_relations.id;

-- -- Name: issue_statuses; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: issue_statuses_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: issue_statuses_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.issue_statuses_id_seq OWNED BY redmine.issue_statuses.id;

-- -- Name: issues_id_seq; Type: SEQUENCE; Schema: redmine; Owner: postgres

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;

-- -- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.issues_id_seq OWNED BY redmine.issues.id;

-- -- Name: journal_details_id_seq; Type: SEQUENCE; Schema: redmine; Owner: postgres

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;

-- -- Name: journal_details_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.journal_details_id_seq OWNED BY redmine.journal_details.id;

-- -- Name: journal_messages; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: journal_messages_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: journal_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.journal_messages_id_seq OWNED BY redmine.journal_messages.id;

-- -- Name: journals_id_seq; Type: SEQUENCE; Schema: redmine; Owner: postgres

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;

-- -- Name: journals_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.journals_id_seq OWNED BY redmine.journals.id;

-- -- Name: member_roles; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: member_roles_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: member_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.member_roles_id_seq OWNED BY redmine.member_roles.id;

-- -- Name: members; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: members_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: members_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.members_id_seq OWNED BY redmine.members.id;

-- -- Name: messages; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: messages_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.messages_id_seq OWNED BY redmine.messages.id;

-- -- Name: news; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: news_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: news_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.news_id_seq OWNED BY redmine.news.id;

-- -- Name: notes; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: notes_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.notes_id_seq OWNED BY redmine.notes.id;

-- -- Name: periodictasks; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: periodictasks_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: periodictasks_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.periodictasks_id_seq OWNED BY redmine.periodictasks.id;

-- -- Name: projects; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: projects_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: projects_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.projects_id_seq OWNED BY redmine.projects.id;

-- -- Name: projects_trackers; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: queries; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: queries_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: queries_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.queries_id_seq OWNED BY redmine.queries.id;

-- -- Name: queries_roles; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.queries_roles ( query_id bigint NOT NULL, role_id bigint NOT NULL );

ALTER TABLE redmine.queries_roles OWNER TO postgres;

-- -- Name: repositories; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: repositories_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.repositories_id_seq OWNED BY redmine.repositories.id;

-- -- Name: roles; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: roles_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.roles_id_seq OWNED BY redmine.roles.id;

-- -- Name: roles_managed_roles; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: schema_migrations; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.schema_migrations ( version character varying(255) NOT NULL );

ALTER TABLE redmine.schema_migrations OWNER TO postgres;

-- -- Name: settings; Type: TABLE; Schema: redmine; Owner: 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;

-- -- Name: settings_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: settings_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.settings_id_seq OWNED BY redmine.settings.id;

-- -- Name: taggings; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: taggings_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: taggings_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.taggings_id_seq OWNED BY redmine.taggings.id;

-- -- Name: tags; Type: TABLE; Schema: redmine; Owner: postgres

CREATE TABLE redmine.tags ( id bigint NOT NULL, name character varying(255) );

ALTER TABLE redmine.tags OWNER TO postgres;

-- -- Name: tags_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.tags_id_seq OWNED BY redmine.tags.id;

-- -- Name: time_entries; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: time_entries_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: time_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.time_entries_id_seq OWNED BY redmine.time_entries.id;

-- -- Name: tokens; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: tokens_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.tokens_id_seq OWNED BY redmine.tokens.id;

-- -- Name: trackers; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: trackers_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: trackers_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.trackers_id_seq OWNED BY redmine.trackers.id;

-- -- Name: user_preferences; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: user_preferences_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: user_preferences_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.user_preferences_id_seq OWNED BY redmine.user_preferences.id;

-- -- Name: users; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: users_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.users_id_seq OWNED BY redmine.users.id;

-- -- Name: versions; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: versions_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: versions_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.versions_id_seq OWNED BY redmine.versions.id;

-- -- Name: watchers; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: watchers_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: watchers_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.watchers_id_seq OWNED BY redmine.watchers.id;

-- -- Name: wiki_content_versions; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: wiki_content_versions_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: wiki_content_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.wiki_content_versions_id_seq OWNED BY redmine.wiki_content_versions.id;

-- -- Name: wiki_contents; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: wiki_contents_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: wiki_contents_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.wiki_contents_id_seq OWNED BY redmine.wiki_contents.id;

-- -- Name: wiki_pages; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: wiki_pages_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: wiki_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.wiki_pages_id_seq OWNED BY redmine.wiki_pages.id;

-- -- Name: wiki_redirects; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: wiki_redirects_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: wiki_redirects_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.wiki_redirects_id_seq OWNED BY redmine.wiki_redirects.id;

-- -- Name: wikis; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: wikis_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: wikis_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.wikis_id_seq OWNED BY redmine.wikis.id;

-- -- Name: workflows; Type: TABLE; Schema: redmine; Owner: postgres

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;

-- -- Name: workflows_id_seq; Type: SEQUENCE; Schema: redmine; Owner: 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;

-- -- Name: workflows_id_seq; Type: SEQUENCE OWNED BY; Schema: redmine; Owner: postgres

ALTER SEQUENCE redmine.workflows_id_seq OWNED BY redmine.workflows.id;

-- -- Name: sla_caches id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_caches ALTER COLUMN id SET DEFAULT nextval('public.sla_caches_id_seq'::regclass);

-- -- Name: sla_calendar_holidays id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_calendar_holidays ALTER COLUMN id SET DEFAULT nextval('public.sla_calendar_holidays_id_seq'::regclass);

-- -- Name: sla_calendars id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_calendars ALTER COLUMN id SET DEFAULT nextval('public.sla_calendars_id_seq'::regclass);

-- -- Name: sla_holidays id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_holidays ALTER COLUMN id SET DEFAULT nextval('public.sla_holidays_id_seq'::regclass);

-- -- Name: sla_level_terms id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_level_terms ALTER COLUMN id SET DEFAULT nextval('public.sla_level_terms_id_seq'::regclass);

-- -- Name: sla_levels id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_levels ALTER COLUMN id SET DEFAULT nextval('public.sla_levels_id_seq'::regclass);

-- -- Name: sla_logs id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_logs ALTER COLUMN id SET DEFAULT nextval('public.sla_logs_id_seq'::regclass);

-- -- Name: sla_project_trackers id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_project_trackers ALTER COLUMN id SET DEFAULT nextval('public.sla_project_trackers_id_seq'::regclass);

-- -- Name: sla_schedules id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_schedules ALTER COLUMN id SET DEFAULT nextval('public.sla_schedules_id_seq'::regclass);

-- -- Name: sla_statuses id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_statuses ALTER COLUMN id SET DEFAULT nextval('public.sla_statuses_id_seq'::regclass);

-- -- Name: sla_types id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_types ALTER COLUMN id SET DEFAULT nextval('public.sla_types_id_seq'::regclass);

-- -- Name: slas id; Type: DEFAULT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.slas ALTER COLUMN id SET DEFAULT nextval('public.slas_id_seq'::regclass);

-- -- Name: addresses id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.addresses ALTER COLUMN id SET DEFAULT nextval('redmine.addresses_id_seq'::regclass);

-- -- Name: agile_colors id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_colors ALTER COLUMN id SET DEFAULT nextval('redmine.agile_colors_id_seq'::regclass);

-- -- Name: agile_data id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_data ALTER COLUMN id SET DEFAULT nextval('redmine.agile_data_id_seq'::regclass);

-- -- Name: agile_sprints id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_sprints ALTER COLUMN id SET DEFAULT nextval('redmine.agile_sprints_id_seq'::regclass);

-- -- Name: attachments id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.attachments ALTER COLUMN id SET DEFAULT nextval('redmine.attachments_id_seq'::regclass);

-- -- Name: auth_sources id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.auth_sources ALTER COLUMN id SET DEFAULT nextval('redmine.auth_sources_id_seq'::regclass);

-- -- Name: boards id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.boards ALTER COLUMN id SET DEFAULT nextval('redmine.boards_id_seq'::regclass);

-- -- Name: canned_responses id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.canned_responses ALTER COLUMN id SET DEFAULT nextval('redmine.canned_responses_id_seq'::regclass);

-- -- Name: changes id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.changes ALTER COLUMN id SET DEFAULT nextval('redmine.changes_id_seq'::regclass);

-- -- Name: changesets id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.changesets ALTER COLUMN id SET DEFAULT nextval('redmine.changesets_id_seq'::regclass);

-- -- Name: checklist_template_categories id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklist_template_categories ALTER COLUMN id SET DEFAULT nextval('redmine.checklist_template_categories_id_seq'::regclass);

-- -- Name: checklist_templates id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklist_templates ALTER COLUMN id SET DEFAULT nextval('redmine.checklist_templates_id_seq'::regclass);

-- -- Name: checklists id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklists ALTER COLUMN id SET DEFAULT nextval('redmine.checklists_id_seq'::regclass);

-- -- Name: comments id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.comments ALTER COLUMN id SET DEFAULT nextval('redmine.comments_id_seq'::regclass);

-- -- Name: contacts id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.contacts ALTER COLUMN id SET DEFAULT nextval('redmine.contacts_id_seq'::regclass);

-- -- Name: contacts_queries id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.contacts_queries ALTER COLUMN id SET DEFAULT nextval('redmine.contacts_queries_id_seq'::regclass);

-- -- Name: custom_field_enumerations id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_field_enumerations ALTER COLUMN id SET DEFAULT nextval('redmine.custom_field_enumerations_id_seq'::regclass);

-- -- Name: custom_fields id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_fields ALTER COLUMN id SET DEFAULT nextval('redmine.custom_fields_id_seq'::regclass);

-- -- Name: custom_values id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_values ALTER COLUMN id SET DEFAULT nextval('redmine.custom_values_id_seq'::regclass);

-- -- Name: deal_categories id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_categories ALTER COLUMN id SET DEFAULT nextval('redmine.deal_categories_id_seq'::regclass);

-- -- Name: deal_processes id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_processes ALTER COLUMN id SET DEFAULT nextval('redmine.deal_processes_id_seq'::regclass);

-- -- Name: deal_statuses id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_statuses ALTER COLUMN id SET DEFAULT nextval('redmine.deal_statuses_id_seq'::regclass);

-- -- Name: deals id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deals ALTER COLUMN id SET DEFAULT nextval('redmine.deals_id_seq'::regclass);

-- -- Name: deals_issues id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deals_issues ALTER COLUMN id SET DEFAULT nextval('redmine.deals_issues_id_seq'::regclass);

-- -- Name: documents id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.documents ALTER COLUMN id SET DEFAULT nextval('redmine.documents_id_seq'::regclass);

-- -- Name: email_addresses id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.email_addresses ALTER COLUMN id SET DEFAULT nextval('redmine.email_addresses_id_seq'::regclass);

-- -- Name: enabled_modules id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.enabled_modules ALTER COLUMN id SET DEFAULT nextval('redmine.enabled_modules_id_seq'::regclass);

-- -- Name: enumerations id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.enumerations ALTER COLUMN id SET DEFAULT nextval('redmine.enumerations_id_seq'::regclass);

-- -- Name: favorite_projects id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.favorite_projects ALTER COLUMN id SET DEFAULT nextval('redmine.favorite_projects_id_seq'::regclass);

-- -- Name: helpdesk_mail_rules id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.helpdesk_mail_rules ALTER COLUMN id SET DEFAULT nextval('redmine.helpdesk_mail_rules_id_seq'::regclass);

-- -- Name: helpdesk_tickets id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.helpdesk_tickets ALTER COLUMN id SET DEFAULT nextval('redmine.helpdesk_tickets_id_seq'::regclass);

-- -- Name: import_items id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.import_items ALTER COLUMN id SET DEFAULT nextval('redmine.import_items_id_seq'::regclass);

-- -- Name: imports id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.imports ALTER COLUMN id SET DEFAULT nextval('redmine.imports_id_seq'::regclass);

-- -- Name: issue_categories id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_categories ALTER COLUMN id SET DEFAULT nextval('redmine.issue_categories_id_seq'::regclass);

-- -- Name: issue_relations id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_relations ALTER COLUMN id SET DEFAULT nextval('redmine.issue_relations_id_seq'::regclass);

-- -- Name: issue_statuses id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_statuses ALTER COLUMN id SET DEFAULT nextval('redmine.issue_statuses_id_seq'::regclass);

-- -- Name: issues id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issues ALTER COLUMN id SET DEFAULT nextval('redmine.issues_id_seq'::regclass);

-- -- Name: journal_details id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journal_details ALTER COLUMN id SET DEFAULT nextval('redmine.journal_details_id_seq'::regclass);

-- -- Name: journal_messages id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journal_messages ALTER COLUMN id SET DEFAULT nextval('redmine.journal_messages_id_seq'::regclass);

-- -- Name: journals id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journals ALTER COLUMN id SET DEFAULT nextval('redmine.journals_id_seq'::regclass);

-- -- Name: member_roles id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.member_roles ALTER COLUMN id SET DEFAULT nextval('redmine.member_roles_id_seq'::regclass);

-- -- Name: members id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.members ALTER COLUMN id SET DEFAULT nextval('redmine.members_id_seq'::regclass);

-- -- Name: messages id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.messages ALTER COLUMN id SET DEFAULT nextval('redmine.messages_id_seq'::regclass);

-- -- Name: news id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.news ALTER COLUMN id SET DEFAULT nextval('redmine.news_id_seq'::regclass);

-- -- Name: notes id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.notes ALTER COLUMN id SET DEFAULT nextval('redmine.notes_id_seq'::regclass);

-- -- Name: periodictasks id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.periodictasks ALTER COLUMN id SET DEFAULT nextval('redmine.periodictasks_id_seq'::regclass);

-- -- Name: projects id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.projects ALTER COLUMN id SET DEFAULT nextval('redmine.projects_id_seq'::regclass);

-- -- Name: queries id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.queries ALTER COLUMN id SET DEFAULT nextval('redmine.queries_id_seq'::regclass);

-- -- Name: repositories id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.repositories ALTER COLUMN id SET DEFAULT nextval('redmine.repositories_id_seq'::regclass);

-- -- Name: roles id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.roles ALTER COLUMN id SET DEFAULT nextval('redmine.roles_id_seq'::regclass);

-- -- Name: settings id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.settings ALTER COLUMN id SET DEFAULT nextval('redmine.settings_id_seq'::regclass);

-- -- Name: taggings id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.taggings ALTER COLUMN id SET DEFAULT nextval('redmine.taggings_id_seq'::regclass);

-- -- Name: tags id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.tags ALTER COLUMN id SET DEFAULT nextval('redmine.tags_id_seq'::regclass);

-- -- Name: time_entries id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.time_entries ALTER COLUMN id SET DEFAULT nextval('redmine.time_entries_id_seq'::regclass);

-- -- Name: tokens id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.tokens ALTER COLUMN id SET DEFAULT nextval('redmine.tokens_id_seq'::regclass);

-- -- Name: trackers id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.trackers ALTER COLUMN id SET DEFAULT nextval('redmine.trackers_id_seq'::regclass);

-- -- Name: user_preferences id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.user_preferences ALTER COLUMN id SET DEFAULT nextval('redmine.user_preferences_id_seq'::regclass);

-- -- Name: users id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.users ALTER COLUMN id SET DEFAULT nextval('redmine.users_id_seq'::regclass);

-- -- Name: versions id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.versions ALTER COLUMN id SET DEFAULT nextval('redmine.versions_id_seq'::regclass);

-- -- Name: watchers id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.watchers ALTER COLUMN id SET DEFAULT nextval('redmine.watchers_id_seq'::regclass);

-- -- Name: wiki_content_versions id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_content_versions ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_content_versions_id_seq'::regclass);

-- -- Name: wiki_contents id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_contents ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_contents_id_seq'::regclass);

-- -- Name: wiki_pages id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_pages ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_pages_id_seq'::regclass);

-- -- Name: wiki_redirects id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_redirects ALTER COLUMN id SET DEFAULT nextval('redmine.wiki_redirects_id_seq'::regclass);

-- -- Name: wikis id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wikis ALTER COLUMN id SET DEFAULT nextval('redmine.wikis_id_seq'::regclass);

-- -- Name: workflows id; Type: DEFAULT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.workflows ALTER COLUMN id SET DEFAULT nextval('redmine.workflows_id_seq'::regclass);

-- -- Name: sla_cache_spents sla_cache_spents_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_cache_spents ADD CONSTRAINT sla_cache_spents_pkey PRIMARY KEY (sla_cache_id, sla_type_id);

-- -- Name: sla_caches sla_caches_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT sla_caches_pkey PRIMARY KEY (id);

-- -- Name: sla_calendar_holidays sla_calendar_holidays_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_calendar_holidays ADD CONSTRAINT sla_calendar_holidays_pkey PRIMARY KEY (id);

-- -- Name: sla_calendars sla_calendars_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_calendars ADD CONSTRAINT sla_calendars_pkey PRIMARY KEY (id);

-- -- Name: sla_holidays sla_holidays_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_holidays ADD CONSTRAINT sla_holidays_pkey PRIMARY KEY (id);

-- -- Name: sla_level_terms sla_level_terms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_level_terms ADD CONSTRAINT sla_level_terms_pkey PRIMARY KEY (id);

-- -- Name: sla_levels sla_levels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT sla_levels_pkey PRIMARY KEY (id);

-- -- Name: sla_logs sla_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT sla_logs_pkey PRIMARY KEY (id);

-- -- Name: sla_project_trackers sla_project_trackers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT sla_project_trackers_pkey PRIMARY KEY (id);

-- -- Name: sla_schedules sla_schedules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_schedules ADD CONSTRAINT sla_schedules_pkey PRIMARY KEY (id);

-- -- Name: sla_statuses sla_statuses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT sla_statuses_pkey PRIMARY KEY (id);

-- -- Name: sla_types sla_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_types ADD CONSTRAINT sla_types_pkey PRIMARY KEY (id);

-- -- Name: slas slas_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.slas ADD CONSTRAINT slas_pkey PRIMARY KEY (id);

-- -- Name: addresses idx_16391_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.addresses ADD CONSTRAINT idx_16391_primary PRIMARY KEY (id);

-- -- Name: agile_colors idx_16398_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_colors ADD CONSTRAINT idx_16398_primary PRIMARY KEY (id);

-- -- Name: agile_data idx_16405_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_data ADD CONSTRAINT idx_16405_primary PRIMARY KEY (id);

-- -- Name: agile_sprints idx_16410_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.agile_sprints ADD CONSTRAINT idx_16410_primary PRIMARY KEY (id);

-- -- Name: ar_internal_metadata idx_16418_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.ar_internal_metadata ADD CONSTRAINT idx_16418_primary PRIMARY KEY (key);

-- -- Name: attachments idx_16424_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.attachments ADD CONSTRAINT idx_16424_primary PRIMARY KEY (id);

-- -- Name: auth_sources idx_16438_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.auth_sources ADD CONSTRAINT idx_16438_primary PRIMARY KEY (id);

-- -- Name: boards idx_16450_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.boards ADD CONSTRAINT idx_16450_primary PRIMARY KEY (id);

-- -- Name: canned_responses idx_16460_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.canned_responses ADD CONSTRAINT idx_16460_primary PRIMARY KEY (id);

-- -- Name: changes idx_16467_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.changes ADD CONSTRAINT idx_16467_primary PRIMARY KEY (id);

-- -- Name: changesets idx_16475_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.changesets ADD CONSTRAINT idx_16475_primary PRIMARY KEY (id);

-- -- Name: checklists idx_16488_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklists ADD CONSTRAINT idx_16488_primary PRIMARY KEY (id);

-- -- Name: checklist_templates idx_16498_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklist_templates ADD CONSTRAINT idx_16498_primary PRIMARY KEY (id);

-- -- Name: checklist_template_categories idx_16506_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.checklist_template_categories ADD CONSTRAINT idx_16506_primary PRIMARY KEY (id);

-- -- Name: comments idx_16512_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.comments ADD CONSTRAINT idx_16512_primary PRIMARY KEY (id);

-- -- Name: contacts idx_16522_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.contacts ADD CONSTRAINT idx_16522_primary PRIMARY KEY (id);

-- -- Name: contacts_queries idx_16545_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.contacts_queries ADD CONSTRAINT idx_16545_primary PRIMARY KEY (id);

-- -- Name: custom_fields idx_16555_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_fields ADD CONSTRAINT idx_16555_primary PRIMARY KEY (id);

-- -- Name: custom_field_enumerations idx_16586_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_field_enumerations ADD CONSTRAINT idx_16586_primary PRIMARY KEY (id);

-- -- Name: custom_values idx_16593_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.custom_values ADD CONSTRAINT idx_16593_primary PRIMARY KEY (id);

-- -- Name: deals idx_16603_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deals ADD CONSTRAINT idx_16603_primary PRIMARY KEY (id);

-- -- Name: deals_issues idx_16611_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deals_issues ADD CONSTRAINT idx_16611_primary PRIMARY KEY (id);

-- -- Name: deal_categories idx_16618_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_categories ADD CONSTRAINT idx_16618_primary PRIMARY KEY (id);

-- -- Name: deal_processes idx_16623_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_processes ADD CONSTRAINT idx_16623_primary PRIMARY KEY (id);

-- -- Name: deal_statuses idx_16628_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.deal_statuses ADD CONSTRAINT idx_16628_primary PRIMARY KEY (id);

-- -- Name: documents idx_16641_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.documents ADD CONSTRAINT idx_16641_primary PRIMARY KEY (id);

-- -- Name: email_addresses idx_16651_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.email_addresses ADD CONSTRAINT idx_16651_primary PRIMARY KEY (id);

-- -- Name: enabled_modules idx_16658_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.enabled_modules ADD CONSTRAINT idx_16658_primary PRIMARY KEY (id);

-- -- Name: enumerations idx_16663_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.enumerations ADD CONSTRAINT idx_16663_primary PRIMARY KEY (id);

-- -- Name: favorite_projects idx_16671_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.favorite_projects ADD CONSTRAINT idx_16671_primary PRIMARY KEY (id);

-- -- Name: helpdesk_mail_rules idx_16679_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.helpdesk_mail_rules ADD CONSTRAINT idx_16679_primary PRIMARY KEY (id);

-- -- Name: helpdesk_tickets idx_16687_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.helpdesk_tickets ADD CONSTRAINT idx_16687_primary PRIMARY KEY (id);

-- -- Name: imports idx_16696_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.imports ADD CONSTRAINT idx_16696_primary PRIMARY KEY (id);

-- -- Name: import_items idx_16704_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.import_items ADD CONSTRAINT idx_16704_primary PRIMARY KEY (id);

-- -- Name: issues idx_16711_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issues ADD CONSTRAINT idx_16711_primary PRIMARY KEY (id);

-- -- Name: issue_categories idx_16722_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_categories ADD CONSTRAINT idx_16722_primary PRIMARY KEY (id);

-- -- Name: issue_relations idx_16729_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_relations ADD CONSTRAINT idx_16729_primary PRIMARY KEY (id);

-- -- Name: issue_statuses idx_16735_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.issue_statuses ADD CONSTRAINT idx_16735_primary PRIMARY KEY (id);

-- -- Name: journals idx_16742_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journals ADD CONSTRAINT idx_16742_primary PRIMARY KEY (id);

-- -- Name: journal_details idx_16753_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journal_details ADD CONSTRAINT idx_16753_primary PRIMARY KEY (id);

-- -- Name: journal_messages idx_16763_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.journal_messages ADD CONSTRAINT idx_16763_primary PRIMARY KEY (id);

-- -- Name: members idx_16771_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.members ADD CONSTRAINT idx_16771_primary PRIMARY KEY (id);

-- -- Name: member_roles idx_16779_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.member_roles ADD CONSTRAINT idx_16779_primary PRIMARY KEY (id);

-- -- Name: messages idx_16784_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.messages ADD CONSTRAINT idx_16784_primary PRIMARY KEY (id);

-- -- Name: news idx_16795_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.news ADD CONSTRAINT idx_16795_primary PRIMARY KEY (id);

-- -- Name: notes idx_16806_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.notes ADD CONSTRAINT idx_16806_primary PRIMARY KEY (id);

-- -- Name: periodictasks idx_16827_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.periodictasks ADD CONSTRAINT idx_16827_primary PRIMARY KEY (id);

-- -- Name: projects idx_16835_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.projects ADD CONSTRAINT idx_16835_primary PRIMARY KEY (id);

-- -- Name: queries idx_16852_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.queries ADD CONSTRAINT idx_16852_primary PRIMARY KEY (id);

-- -- Name: repositories idx_16865_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.repositories ADD CONSTRAINT idx_16865_primary PRIMARY KEY (id);

-- -- Name: roles idx_16878_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.roles ADD CONSTRAINT idx_16878_primary PRIMARY KEY (id);

-- -- Name: settings idx_16898_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.settings ADD CONSTRAINT idx_16898_primary PRIMARY KEY (id);

-- -- Name: taggings idx_16906_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.taggings ADD CONSTRAINT idx_16906_primary PRIMARY KEY (id);

-- -- Name: tags idx_16911_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.tags ADD CONSTRAINT idx_16911_primary PRIMARY KEY (id);

-- -- Name: time_entries idx_16916_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.time_entries ADD CONSTRAINT idx_16916_primary PRIMARY KEY (id);

-- -- Name: tokens idx_16923_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.tokens ADD CONSTRAINT idx_16923_primary PRIMARY KEY (id);

-- -- Name: trackers idx_16931_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.trackers ADD CONSTRAINT idx_16931_primary PRIMARY KEY (id);

-- -- Name: users idx_16940_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.users ADD CONSTRAINT idx_16940_primary PRIMARY KEY (id);

-- -- Name: user_preferences idx_16956_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.user_preferences ADD CONSTRAINT idx_16956_primary PRIMARY KEY (id);

-- -- Name: versions idx_16965_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.versions ADD CONSTRAINT idx_16965_primary PRIMARY KEY (id);

-- -- Name: watchers idx_16977_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.watchers ADD CONSTRAINT idx_16977_primary PRIMARY KEY (id);

-- -- Name: wikis idx_16984_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wikis ADD CONSTRAINT idx_16984_primary PRIMARY KEY (id);

-- -- Name: wiki_contents idx_16990_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_contents ADD CONSTRAINT idx_16990_primary PRIMARY KEY (id);

-- -- Name: wiki_content_versions idx_16998_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_content_versions ADD CONSTRAINT idx_16998_primary PRIMARY KEY (id);

-- -- Name: wiki_pages idx_17007_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_pages ADD CONSTRAINT idx_17007_primary PRIMARY KEY (id);

-- -- Name: wiki_redirects idx_17013_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.wiki_redirects ADD CONSTRAINT idx_17013_primary PRIMARY KEY (id);

-- -- Name: workflows idx_17020_primary; Type: CONSTRAINT; Schema: redmine; Owner: postgres

ALTER TABLE ONLY redmine.workflows ADD CONSTRAINT idx_17020_primary PRIMARY KEY (id);

-- -- Name: index_sla_cache_spents_on_sla_cache_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_cache_spents_on_sla_cache_id ON public.sla_cache_spents USING btree (sla_cache_id);

-- -- Name: index_sla_cache_spents_on_sla_type_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_cache_spents_on_sla_type_id ON public.sla_cache_spents USING btree (sla_type_id);

-- -- Name: index_sla_caches_on_issue_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_caches_on_issue_id ON public.sla_caches USING btree (issue_id);

-- -- Name: index_sla_caches_on_sla_level_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_caches_on_sla_level_id ON public.sla_caches USING btree (sla_level_id);

-- -- Name: index_sla_calendar_holidays_on_sla_calendar_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_calendar_holidays_on_sla_calendar_id ON public.sla_calendar_holidays USING btree (sla_calendar_id);

-- -- Name: index_sla_calendar_holidays_on_sla_holiday_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_calendar_holidays_on_sla_holiday_id ON public.sla_calendar_holidays USING btree (sla_holiday_id);

-- -- Name: index_sla_calendars_on_name; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX index_sla_calendars_on_name ON public.sla_calendars USING btree (name);

-- -- Name: index_sla_holidays_on_date; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX index_sla_holidays_on_date ON public.sla_holidays USING btree (date);

-- -- Name: index_sla_level_terms_on_sla_level_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_level_terms_on_sla_level_id ON public.sla_level_terms USING btree (sla_level_id);

-- -- Name: index_sla_level_terms_on_sla_type_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_level_terms_on_sla_type_id ON public.sla_level_terms USING btree (sla_type_id);

-- -- Name: index_sla_levels_on_name; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX index_sla_levels_on_name ON public.sla_levels USING btree (name);

-- -- Name: index_sla_levels_on_sla_calendar_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_levels_on_sla_calendar_id ON public.sla_levels USING btree (sla_calendar_id);

-- -- Name: index_sla_levels_on_sla_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_levels_on_sla_id ON public.sla_levels USING btree (sla_id);

-- -- Name: index_sla_logs_on_issue_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_logs_on_issue_id ON public.sla_logs USING btree (issue_id);

-- -- Name: index_sla_logs_on_project_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_logs_on_project_id ON public.sla_logs USING btree (project_id);

-- -- Name: index_sla_logs_on_sla_level_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_logs_on_sla_level_id ON public.sla_logs USING btree (sla_level_id);

-- -- Name: index_sla_project_trackers_on_project_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_project_trackers_on_project_id ON public.sla_project_trackers USING btree (project_id);

-- -- Name: index_sla_project_trackers_on_sla_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_project_trackers_on_sla_id ON public.sla_project_trackers USING btree (sla_id);

-- -- Name: index_sla_project_trackers_on_tracker_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_project_trackers_on_tracker_id ON public.sla_project_trackers USING btree (tracker_id);

-- -- Name: index_sla_schedules_on_sla_calendar_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_schedules_on_sla_calendar_id ON public.sla_schedules USING btree (sla_calendar_id);

-- -- Name: index_sla_statuses_on_sla_type_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_statuses_on_sla_type_id ON public.sla_statuses USING btree (sla_type_id);

-- -- Name: index_sla_statuses_on_status_id; Type: INDEX; Schema: public; Owner: postgres

CREATE INDEX index_sla_statuses_on_status_id ON public.sla_statuses USING btree (status_id);

-- -- Name: index_sla_types_on_name; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX index_sla_types_on_name ON public.sla_types USING btree (name);

-- -- Name: index_slas_on_name; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX index_slas_on_name ON public.slas USING btree (name);

-- -- Name: sla_cache_issue_level_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_cache_issue_level_ukey ON public.sla_caches USING btree (issue_id, sla_level_id);

-- -- Name: sla_cache_issue_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_cache_issue_ukey ON public.sla_caches USING btree (issue_id);

-- -- Name: sla_calendar_holidays_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_calendar_holidays_ukey ON public.sla_calendar_holidays USING btree (sla_calendar_id, sla_holiday_id);

-- -- Name: sla_level_terms_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_level_terms_ukey ON public.sla_level_terms USING btree (sla_level_id, sla_type_id, priority_id);

-- -- Name: sla_project_trackers_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_project_trackers_ukey ON public.sla_project_trackers USING btree (project_id, tracker_id);

-- -- Name: sla_schedules_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_schedules_ukey ON public.sla_schedules USING btree (sla_calendar_id, dow, start_time, end_time);

-- -- Name: sla_statuses_ukey; Type: INDEX; Schema: public; Owner: postgres

CREATE UNIQUE INDEX sla_statuses_ukey ON public.sla_statuses USING btree (status_id, sla_type_id);

-- -- Name: custom_values_customized_custom_field; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX custom_values_customized_custom_field ON redmine.custom_values USING btree (customized_type, customized_id, custom_field_id);

-- -- Name: idx_16391_index_addresses_on_address_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16391_index_addresses_on_address_type ON redmine.addresses USING btree (address_type);

-- -- Name: idx_16391_index_addresses_on_addressable_id_and_addressable_typ; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16391_index_addresses_on_addressable_id_and_addressable_typ ON redmine.addresses USING btree (addressable_id, addressable_type);

-- -- Name: idx_16398_index_agile_colors_on_container_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16398_index_agile_colors_on_container_id ON redmine.agile_colors USING btree (container_id);

-- -- Name: idx_16398_index_agile_colors_on_container_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16398_index_agile_colors_on_container_type ON redmine.agile_colors USING btree (container_type);

-- -- Name: idx_16405_index_agile_data_on_issue_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16405_index_agile_data_on_issue_id ON redmine.agile_data USING btree (issue_id);

-- -- Name: idx_16405_index_agile_data_on_position; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16405_index_agile_data_on_position ON redmine.agile_data USING btree ("position");

-- -- Name: idx_16424_index_attachments_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16424_index_attachments_on_author_id ON redmine.attachments USING btree (author_id);

-- -- Name: idx_16424_index_attachments_on_container_id_and_container_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16424_index_attachments_on_container_id_and_container_type ON redmine.attachments USING btree (container_id, container_type);

-- -- Name: idx_16424_index_attachments_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16424_index_attachments_on_created_on ON redmine.attachments USING btree (created_on);

-- -- Name: idx_16424_index_attachments_on_disk_filename; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16424_index_attachments_on_disk_filename ON redmine.attachments USING btree (disk_filename);

-- -- Name: idx_16438_index_auth_sources_on_id_and_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16438_index_auth_sources_on_id_and_type ON redmine.auth_sources USING btree (id, type);

-- -- Name: idx_16450_boards_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16450_boards_project_id ON redmine.boards USING btree (project_id);

-- -- Name: idx_16450_index_boards_on_last_message_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16450_index_boards_on_last_message_id ON redmine.boards USING btree (last_message_id);

-- -- Name: idx_16467_changesets_changeset_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16467_changesets_changeset_id ON redmine.changes USING btree (changeset_id);

-- -- Name: idx_16475_changesets_repos_rev; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16475_changesets_repos_rev ON redmine.changesets USING btree (repository_id, revision);

-- -- Name: idx_16475_changesets_repos_scmid; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16475_changesets_repos_scmid ON redmine.changesets USING btree (repository_id, scmid);

-- -- Name: idx_16475_index_changesets_on_committed_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16475_index_changesets_on_committed_on ON redmine.changesets USING btree (committed_on);

-- -- Name: idx_16475_index_changesets_on_repository_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16475_index_changesets_on_repository_id ON redmine.changesets USING btree (repository_id);

-- -- Name: idx_16475_index_changesets_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16475_index_changesets_on_user_id ON redmine.changesets USING btree (user_id);

-- -- Name: idx_16481_changesets_issues_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16481_changesets_issues_ids ON redmine.changesets_issues USING btree (changeset_id, issue_id);

-- -- Name: idx_16481_index_changesets_issues_on_issue_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16481_index_changesets_issues_on_issue_id ON redmine.changesets_issues USING btree (issue_id);

-- -- Name: idx_16484_changeset_parents_changeset_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16484_changeset_parents_changeset_ids ON redmine.changeset_parents USING btree (changeset_id);

-- -- Name: idx_16484_changeset_parents_parent_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16484_changeset_parents_parent_ids ON redmine.changeset_parents USING btree (parent_id);

-- -- Name: idx_16498_index_checklist_templates_on_tracker_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16498_index_checklist_templates_on_tracker_id ON redmine.checklist_templates USING btree (tracker_id);

-- -- Name: idx_16512_index_comments_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16512_index_comments_on_author_id ON redmine.comments USING btree (author_id);

-- -- Name: idx_16512_index_comments_on_commented_id_and_commented_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16512_index_comments_on_commented_id_and_commented_type ON redmine.comments USING btree (commented_id, commented_type);

-- -- Name: idx_16522_index_contacts_on_assigned_to_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_assigned_to_id ON redmine.contacts USING btree (assigned_to_id);

-- -- Name: idx_16522_index_contacts_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_author_id ON redmine.contacts USING btree (author_id);

-- -- Name: idx_16522_index_contacts_on_company; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_company ON redmine.contacts USING btree (company);

-- -- Name: idx_16522_index_contacts_on_email; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_email ON redmine.contacts USING btree (email);

-- -- Name: idx_16522_index_contacts_on_first_name; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_first_name ON redmine.contacts USING btree (first_name);

-- -- Name: idx_16522_index_contacts_on_is_company; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16522_index_contacts_on_is_company ON redmine.contacts USING btree (is_company);

-- -- Name: idx_16531_index_contacts_deals_on_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16531_index_contacts_deals_on_contact_id ON redmine.contacts_deals USING btree (contact_id);

-- -- Name: idx_16531_index_contacts_deals_on_deal_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16531_index_contacts_deals_on_deal_id ON redmine.contacts_deals USING btree (deal_id);

-- -- Name: idx_16534_index_contacts_issues_on_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16534_index_contacts_issues_on_contact_id ON redmine.contacts_issues USING btree (contact_id);

-- -- Name: idx_16534_index_contacts_issues_on_issue_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16534_index_contacts_issues_on_issue_id ON redmine.contacts_issues USING btree (issue_id);

-- -- Name: idx_16539_index_contacts_projects_on_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16539_index_contacts_projects_on_contact_id ON redmine.contacts_projects USING btree (contact_id);

-- -- Name: idx_16539_index_contacts_projects_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16539_index_contacts_projects_on_project_id ON redmine.contacts_projects USING btree (project_id);

-- -- Name: idx_16545_index_contacts_queries_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16545_index_contacts_queries_on_project_id ON redmine.contacts_queries USING btree (project_id);

-- -- Name: idx_16545_index_contacts_queries_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16545_index_contacts_queries_on_user_id ON redmine.contacts_queries USING btree (user_id);

-- -- Name: idx_16555_index_custom_fields_on_id_and_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16555_index_custom_fields_on_id_and_type ON redmine.custom_fields USING btree (id, type);

-- -- Name: idx_16572_index_custom_fields_projects_on_custom_field_id_and_p; Type: INDEX; Schema: redmine; Owner: postgres

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);

-- -- Name: idx_16577_custom_fields_roles_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16577_custom_fields_roles_ids ON redmine.custom_fields_roles USING btree (custom_field_id, role_id);

-- -- Name: idx_16580_index_custom_fields_trackers_on_custom_field_id_and_t; Type: INDEX; Schema: redmine; Owner: postgres

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);

-- -- Name: idx_16593_custom_values_customized; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16593_custom_values_customized ON redmine.custom_values USING btree (customized_type, customized_id);

-- -- Name: idx_16593_index_custom_values_on_custom_field_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16593_index_custom_values_on_custom_field_id ON redmine.custom_values USING btree (custom_field_id);

-- -- Name: idx_16603_index_deals_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16603_index_deals_on_author_id ON redmine.deals USING btree (author_id);

-- -- Name: idx_16603_index_deals_on_category_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16603_index_deals_on_category_id ON redmine.deals USING btree (category_id);

-- -- Name: idx_16603_index_deals_on_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16603_index_deals_on_contact_id ON redmine.deals USING btree (contact_id);

-- -- Name: idx_16603_index_deals_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16603_index_deals_on_project_id ON redmine.deals USING btree (project_id);

-- -- Name: idx_16603_index_deals_on_status_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16603_index_deals_on_status_id ON redmine.deals USING btree (status_id);

-- -- Name: idx_16611_index_deals_issues_on_deal_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16611_index_deals_issues_on_deal_id ON redmine.deals_issues USING btree (deal_id);

-- -- Name: idx_16611_index_deals_issues_on_issue_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16611_index_deals_issues_on_issue_id ON redmine.deals_issues USING btree (issue_id);

-- -- Name: idx_16618_index_deal_categories_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16618_index_deal_categories_on_project_id ON redmine.deal_categories USING btree (project_id);

-- -- Name: idx_16623_index_deal_processes_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16623_index_deal_processes_on_author_id ON redmine.deal_processes USING btree (author_id);

-- -- Name: idx_16623_index_deal_processes_on_deal_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16623_index_deal_processes_on_deal_id ON redmine.deal_processes USING btree (deal_id);

-- -- Name: idx_16635_index_deal_statuses_projects_on_project_id_and_deal_s; Type: INDEX; Schema: redmine; Owner: postgres

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);

-- -- Name: idx_16641_documents_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16641_documents_project_id ON redmine.documents USING btree (project_id);

-- -- Name: idx_16641_index_documents_on_category_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16641_index_documents_on_category_id ON redmine.documents USING btree (category_id);

-- -- Name: idx_16641_index_documents_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16641_index_documents_on_created_on ON redmine.documents USING btree (created_on);

-- -- Name: idx_16651_index_email_addresses_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16651_index_email_addresses_on_user_id ON redmine.email_addresses USING btree (user_id);

-- -- Name: idx_16658_enabled_modules_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16658_enabled_modules_project_id ON redmine.enabled_modules USING btree (project_id);

-- -- Name: idx_16663_index_enumerations_on_id_and_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16663_index_enumerations_on_id_and_type ON redmine.enumerations USING btree (id, type);

-- -- Name: idx_16663_index_enumerations_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16663_index_enumerations_on_project_id ON redmine.enumerations USING btree (project_id);

-- -- Name: idx_16675_groups_users_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16675_groups_users_ids ON redmine.groups_users USING btree (group_id, user_id);

-- -- Name: idx_16687_index_helpdesk_tickets_on_issue_id_and_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16687_index_helpdesk_tickets_on_issue_id_and_contact_id ON redmine.helpdesk_tickets USING btree (issue_id, contact_id);

-- -- Name: idx_16687_index_helpdesk_tickets_on_message_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16687_index_helpdesk_tickets_on_message_id ON redmine.helpdesk_tickets USING btree (message_id);

-- -- Name: idx_16711_index_issues_on_assigned_to_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_assigned_to_id ON redmine.issues USING btree (assigned_to_id);

-- -- Name: idx_16711_index_issues_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_author_id ON redmine.issues USING btree (author_id);

-- -- Name: idx_16711_index_issues_on_category_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_category_id ON redmine.issues USING btree (category_id);

-- -- Name: idx_16711_index_issues_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_created_on ON redmine.issues USING btree (created_on);

-- -- Name: idx_16711_index_issues_on_fixed_version_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_fixed_version_id ON redmine.issues USING btree (fixed_version_id);

-- -- Name: idx_16711_index_issues_on_parent_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_parent_id ON redmine.issues USING btree (parent_id);

-- -- Name: idx_16711_index_issues_on_priority_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_priority_id ON redmine.issues USING btree (priority_id);

-- -- Name: idx_16711_index_issues_on_root_id_and_lft_and_rgt; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_root_id_and_lft_and_rgt ON redmine.issues USING btree (root_id, lft, rgt);

-- -- Name: idx_16711_index_issues_on_status_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_status_id ON redmine.issues USING btree (status_id);

-- -- Name: idx_16711_index_issues_on_tracker_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_index_issues_on_tracker_id ON redmine.issues USING btree (tracker_id);

-- -- Name: idx_16711_issues_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16711_issues_project_id ON redmine.issues USING btree (project_id);

-- -- Name: idx_16722_index_issue_categories_on_assigned_to_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16722_index_issue_categories_on_assigned_to_id ON redmine.issue_categories USING btree (assigned_to_id);

-- -- Name: idx_16722_issue_categories_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16722_issue_categories_project_id ON redmine.issue_categories USING btree (project_id);

-- -- Name: idx_16729_index_issue_relations_on_issue_from_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16729_index_issue_relations_on_issue_from_id ON redmine.issue_relations USING btree (issue_from_id);

-- -- Name: idx_16729_index_issue_relations_on_issue_from_id_and_issue_to_i; Type: INDEX; Schema: redmine; Owner: postgres

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);

-- -- Name: idx_16729_index_issue_relations_on_issue_to_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16729_index_issue_relations_on_issue_to_id ON redmine.issue_relations USING btree (issue_to_id);

-- -- Name: idx_16735_index_issue_statuses_on_is_closed; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16735_index_issue_statuses_on_is_closed ON redmine.issue_statuses USING btree (is_closed);

-- -- Name: idx_16735_index_issue_statuses_on_position; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16735_index_issue_statuses_on_position ON redmine.issue_statuses USING btree ("position");

-- -- Name: idx_16742_index_journals_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16742_index_journals_on_created_on ON redmine.journals USING btree (created_on);

-- -- Name: idx_16742_index_journals_on_journalized_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16742_index_journals_on_journalized_id ON redmine.journals USING btree (journalized_id);

-- -- Name: idx_16742_index_journals_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16742_index_journals_on_user_id ON redmine.journals USING btree (user_id);

-- -- Name: idx_16742_journals_journalized_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16742_journals_journalized_id ON redmine.journals USING btree (journalized_id, journalized_type);

-- -- Name: idx_16753_journal_details_journal_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16753_journal_details_journal_id ON redmine.journal_details USING btree (journal_id);

-- -- Name: idx_16763_index_journal_messages_on_journal_id_and_contact_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16763_index_journal_messages_on_journal_id_and_contact_id ON redmine.journal_messages USING btree (journal_id, contact_id);

-- -- Name: idx_16763_index_journal_messages_on_message_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16763_index_journal_messages_on_message_id ON redmine.journal_messages USING btree (message_id);

-- -- Name: idx_16771_index_members_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16771_index_members_on_project_id ON redmine.members USING btree (project_id);

-- -- Name: idx_16771_index_members_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16771_index_members_on_user_id ON redmine.members USING btree (user_id);

-- -- Name: idx_16771_index_members_on_user_id_and_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16771_index_members_on_user_id_and_project_id ON redmine.members USING btree (user_id, project_id);

-- -- Name: idx_16779_index_member_roles_on_inherited_from; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16779_index_member_roles_on_inherited_from ON redmine.member_roles USING btree (inherited_from);

-- -- Name: idx_16779_index_member_roles_on_member_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16779_index_member_roles_on_member_id ON redmine.member_roles USING btree (member_id);

-- -- Name: idx_16779_index_member_roles_on_role_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16779_index_member_roles_on_role_id ON redmine.member_roles USING btree (role_id);

-- -- Name: idx_16784_index_messages_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16784_index_messages_on_author_id ON redmine.messages USING btree (author_id);

-- -- Name: idx_16784_index_messages_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16784_index_messages_on_created_on ON redmine.messages USING btree (created_on);

-- -- Name: idx_16784_index_messages_on_last_reply_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16784_index_messages_on_last_reply_id ON redmine.messages USING btree (last_reply_id);

-- -- Name: idx_16784_messages_board_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16784_messages_board_id ON redmine.messages USING btree (board_id);

-- -- Name: idx_16784_messages_parent_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16784_messages_parent_id ON redmine.messages USING btree (parent_id);

-- -- Name: idx_16795_index_news_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16795_index_news_on_author_id ON redmine.news USING btree (author_id);

-- -- Name: idx_16795_index_news_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16795_index_news_on_created_on ON redmine.news USING btree (created_on);

-- -- Name: idx_16795_news_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16795_news_project_id ON redmine.news USING btree (project_id);

-- -- Name: idx_16806_index_notes_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16806_index_notes_on_author_id ON redmine.notes USING btree (author_id);

-- -- Name: idx_16806_index_notes_on_source_id_and_source_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16806_index_notes_on_source_id_and_source_type ON redmine.notes USING btree (source_id, source_type);

-- -- Name: idx_16806_index_notes_on_type_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16806_index_notes_on_type_id ON redmine.notes USING btree (type_id);

-- -- Name: idx_16835_index_projects_on_lft; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16835_index_projects_on_lft ON redmine.projects USING btree (lft);

-- -- Name: idx_16835_index_projects_on_rgt; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16835_index_projects_on_rgt ON redmine.projects USING btree (rgt);

-- -- Name: idx_16846_projects_trackers_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16846_projects_trackers_project_id ON redmine.projects_trackers USING btree (project_id);

-- -- Name: idx_16846_projects_trackers_unique; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16846_projects_trackers_unique ON redmine.projects_trackers USING btree (project_id, tracker_id);

-- -- Name: idx_16852_index_queries_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16852_index_queries_on_project_id ON redmine.queries USING btree (project_id);

-- -- Name: idx_16852_index_queries_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16852_index_queries_on_user_id ON redmine.queries USING btree (user_id);

-- -- Name: idx_16861_queries_roles_ids; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16861_queries_roles_ids ON redmine.queries_roles USING btree (query_id, role_id);

-- -- Name: idx_16865_index_repositories_on_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16865_index_repositories_on_project_id ON redmine.repositories USING btree (project_id);

-- -- Name: idx_16891_index_roles_managed_roles_on_role_id_and_managed_role; Type: INDEX; Schema: redmine; Owner: postgres

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);

-- -- Name: idx_16894_unique_schema_migrations; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16894_unique_schema_migrations ON redmine.schema_migrations USING btree (version);

-- -- Name: idx_16898_index_settings_on_name; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16898_index_settings_on_name ON redmine.settings USING btree (name);

-- -- Name: idx_16906_index_taggings_on_tag_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16906_index_taggings_on_tag_id ON redmine.taggings USING btree (tag_id);

-- -- Name: idx_16906_index_taggings_on_taggable_id_and_taggable_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16906_index_taggings_on_taggable_id_and_taggable_type ON redmine.taggings USING btree (taggable_id, taggable_type);

-- -- Name: idx_16916_index_time_entries_on_activity_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16916_index_time_entries_on_activity_id ON redmine.time_entries USING btree (activity_id);

-- -- Name: idx_16916_index_time_entries_on_created_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16916_index_time_entries_on_created_on ON redmine.time_entries USING btree (created_on);

-- -- Name: idx_16916_index_time_entries_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16916_index_time_entries_on_user_id ON redmine.time_entries USING btree (user_id);

-- -- Name: idx_16916_time_entries_issue_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16916_time_entries_issue_id ON redmine.time_entries USING btree (issue_id);

-- -- Name: idx_16916_time_entries_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16916_time_entries_project_id ON redmine.time_entries USING btree (project_id);

-- -- Name: idx_16923_index_tokens_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16923_index_tokens_on_user_id ON redmine.tokens USING btree (user_id);

-- -- Name: idx_16923_tokens_value; Type: INDEX; Schema: redmine; Owner: postgres

CREATE UNIQUE INDEX idx_16923_tokens_value ON redmine.tokens USING btree (value);

-- -- Name: idx_16940_index_users_on_auth_source_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16940_index_users_on_auth_source_id ON redmine.users USING btree (auth_source_id);

-- -- Name: idx_16940_index_users_on_id_and_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16940_index_users_on_id_and_type ON redmine.users USING btree (id, type);

-- -- Name: idx_16940_index_users_on_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16940_index_users_on_type ON redmine.users USING btree (type);

-- -- Name: idx_16956_index_user_preferences_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16956_index_user_preferences_on_user_id ON redmine.user_preferences USING btree (user_id);

-- -- Name: idx_16965_index_versions_on_sharing; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16965_index_versions_on_sharing ON redmine.versions USING btree (sharing);

-- -- Name: idx_16965_versions_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16965_versions_project_id ON redmine.versions USING btree (project_id);

-- -- Name: idx_16977_index_watchers_on_user_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16977_index_watchers_on_user_id ON redmine.watchers USING btree (user_id);

-- -- Name: idx_16977_index_watchers_on_watchable_id_and_watchable_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16977_index_watchers_on_watchable_id_and_watchable_type ON redmine.watchers USING btree (watchable_id, watchable_type);

-- -- Name: idx_16977_watchers_user_id_type; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16977_watchers_user_id_type ON redmine.watchers USING btree (user_id, watchable_type);

-- -- Name: idx_16984_wikis_project_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16984_wikis_project_id ON redmine.wikis USING btree (project_id);

-- -- Name: idx_16990_index_wiki_contents_on_author_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16990_index_wiki_contents_on_author_id ON redmine.wiki_contents USING btree (author_id);

-- -- Name: idx_16990_wiki_contents_page_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16990_wiki_contents_page_id ON redmine.wiki_contents USING btree (page_id);

-- -- Name: idx_16998_index_wiki_content_versions_on_updated_on; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16998_index_wiki_content_versions_on_updated_on ON redmine.wiki_content_versions USING btree (updated_on);

-- -- Name: idx_16998_wiki_content_versions_wcid; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_16998_wiki_content_versions_wcid ON redmine.wiki_content_versions USING btree (wiki_content_id);

-- -- Name: idx_17007_index_wiki_pages_on_parent_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17007_index_wiki_pages_on_parent_id ON redmine.wiki_pages USING btree (parent_id);

-- -- Name: idx_17007_index_wiki_pages_on_wiki_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17007_index_wiki_pages_on_wiki_id ON redmine.wiki_pages USING btree (wiki_id);

-- -- Name: idx_17007_wiki_pages_wiki_id_title; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17007_wiki_pages_wiki_id_title ON redmine.wiki_pages USING btree (wiki_id, title);

-- -- Name: idx_17013_index_wiki_redirects_on_wiki_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17013_index_wiki_redirects_on_wiki_id ON redmine.wiki_redirects USING btree (wiki_id);

-- -- Name: idx_17013_wiki_redirects_wiki_id_title; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17013_wiki_redirects_wiki_id_title ON redmine.wiki_redirects USING btree (wiki_id, title);

-- -- Name: idx_17020_index_workflows_on_new_status_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17020_index_workflows_on_new_status_id ON redmine.workflows USING btree (new_status_id);

-- -- Name: idx_17020_index_workflows_on_old_status_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17020_index_workflows_on_old_status_id ON redmine.workflows USING btree (old_status_id);

-- -- Name: idx_17020_index_workflows_on_role_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17020_index_workflows_on_role_id ON redmine.workflows USING btree (role_id);

-- -- Name: idx_17020_index_workflows_on_tracker_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17020_index_workflows_on_tracker_id ON redmine.workflows USING btree (tracker_id);

-- -- Name: idx_17020_wkfs_role_tracker_old_status; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX idx_17020_wkfs_role_tracker_old_status ON redmine.workflows USING btree (role_id, tracker_id, old_status_id);

-- -- Name: index_import_items_on_import_id_and_unique_id; Type: INDEX; Schema: redmine; Owner: postgres

CREATE INDEX index_import_items_on_import_id_and_unique_id ON redmine.import_items USING btree (import_id, unique_id);

-- -- Name: sla_project_trackers fk_rails_0c39d09223; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_0c39d09223 FOREIGN KEY (sla_id) REFERENCES public.slas(id) ON DELETE CASCADE;

-- -- Name: sla_levels fk_rails_11cf1a945c; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT fk_rails_11cf1a945c FOREIGN KEY (sla_calendar_id) REFERENCES public.sla_calendars(id) ON DELETE CASCADE;

-- -- Name: sla_caches fk_rails_16874bf5c3; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT fk_rails_16874bf5c3 FOREIGN KEY (sla_level_id) REFERENCES public.sla_levels(id) ON DELETE CASCADE;

-- -- Name: sla_caches fk_rails_362572edd0; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_caches ADD CONSTRAINT fk_rails_362572edd0 FOREIGN KEY (issue_id) REFERENCES redmine.issues(id) ON DELETE CASCADE;

-- -- Name: sla_schedules fk_rails_42761b6131; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_schedules ADD CONSTRAINT fk_rails_42761b6131 FOREIGN KEY (sla_calendar_id) REFERENCES public.sla_calendars(id) ON DELETE CASCADE;

-- -- Name: sla_statuses fk_rails_4493143516; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT fk_rails_4493143516 FOREIGN KEY (status_id) REFERENCES redmine.issue_statuses(id) ON DELETE CASCADE;

-- -- Name: sla_cache_spents fk_rails_4b64c2b9dd; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_logs fk_rails_574e6fb859; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_574e6fb859 FOREIGN KEY (sla_level_id) REFERENCES public.sla_levels(id) ON DELETE CASCADE;

-- -- Name: sla_calendar_holidays fk_rails_884a921bf9; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_project_trackers fk_rails_95254dedd5; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_95254dedd5 FOREIGN KEY (project_id) REFERENCES redmine.projects(id) ON DELETE CASCADE;

-- -- Name: sla_levels fk_rails_9a557abf1b; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_levels ADD CONSTRAINT fk_rails_9a557abf1b FOREIGN KEY (sla_id) REFERENCES public.slas(id) ON DELETE CASCADE;

-- -- Name: sla_cache_spents fk_rails_9cd56ac0f1; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_statuses fk_rails_a27f9e47d0; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_statuses ADD CONSTRAINT fk_rails_a27f9e47d0 FOREIGN KEY (sla_type_id) REFERENCES public.sla_types(id) ON DELETE CASCADE;

-- -- Name: sla_calendar_holidays fk_rails_dd490be0af; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_logs fk_rails_ec396598c2; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_ec396598c2 FOREIGN KEY (issue_id) REFERENCES redmine.issues(id) ON DELETE CASCADE;

-- -- Name: sla_level_terms fk_rails_ef6d7419c6; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_logs fk_rails_f75f2aa0c6; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_logs ADD CONSTRAINT fk_rails_f75f2aa0c6 FOREIGN KEY (project_id) REFERENCES redmine.projects(id) ON DELETE CASCADE;

-- -- Name: sla_level_terms fk_rails_f83416cf83; Type: FK CONSTRAINT; Schema: public; Owner: postgres

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;

-- -- Name: sla_project_trackers fk_rails_fdecde5316; Type: FK CONSTRAINT; Schema: public; Owner: postgres

ALTER TABLE ONLY public.sla_project_trackers ADD CONSTRAINT fk_rails_fdecde5316 FOREIGN KEY (tracker_id) REFERENCES redmine.trackers(id) ON DELETE CASCADE;

-- -- PostgreSQL database dump complete

`

likehopper commented 10 months ago

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 ?

likehopper commented 10 months ago

Personally, I use this configuration file to switch Redmine from MySQL to PostgreSQL. redmine_migration.txt

opino commented 10 months ago

@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.