text: --
  -- PostgreSQL database dump
  --
  
  -- Dumped from database version 12.5
  -- Dumped by pg_dump version 12.2
  
  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;
  
  DROP DATABASE #DB_NAME#;
  --
  -- Name: #DB_NAME#; Type: DATABASE; Schema: -; Owner: #DB_OWNER#
  --
  
  CREATE DATABASE #DB_NAME# WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
  
  
  ALTER DATABASE #DB_NAME# OWNER TO #DB_OWNER#;
  
  \connect #DB_NAME#
  
  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;
  
  SET default_tablespace = '';
  
  SET default_table_access_method = heap;
  
  --
  -- Name: ban_banknote; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.ban_banknote (
      ban_id integer NOT NULL,
      ban_ser_id integer NOT NULL,
      ban_cus_id integer NOT NULL,
      ban_face_value real NOT NULL,
      ban_mat_id integer,
      ban_obverse_desc text,
      ban_reverse_desc text,
      ban_obverse_tags text,
      ban_reverse_tags text,
      ban_size_width integer,
      ban_size_height integer,
      ban_description text
  );
  
  
  ALTER TABLE public.ban_banknote OWNER TO #DB_OWNER#;
  
  --
  -- Name: ban_banknote_ban_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.ban_banknote ALTER COLUMN ban_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.ban_banknote_ban_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: bit_item; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.bit_item (
      bit_id integer NOT NULL,
      bit_usr_id integer NOT NULL,
      bit_bva_id integer NOT NULL,
      bit_quantity integer NOT NULL,
      bit_gra_grade text NOT NULL,
      bit_price real NOT NULL,
      bit_seller text,
      bit_purchase_date text,
      bit_description text
  );
  
  
  ALTER TABLE public.bit_item OWNER TO #DB_OWNER#;
  
  --
  -- Name: bit_item_bit_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.bit_item ALTER COLUMN bit_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.bit_item_bit_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: bta_banknote_tag; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.bta_banknote_tag (
      bta_id integer NOT NULL,
      bta_ban_id integer NOT NULL,
      bta_side text DEFAULT 'O'::text NOT NULL,
      bta_tag text NOT NULL
  );
  
  
  ALTER TABLE public.bta_banknote_tag OWNER TO #DB_OWNER#;
  
  --
  -- Name: bta_banknote_tag_bta_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.bta_banknote_tag ALTER COLUMN bta_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.bta_banknote_tag_bta_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: bva_variant; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.bva_variant (
      bva_id integer NOT NULL,
      bva_ban_id integer NOT NULL,
      bva_issue_year integer NOT NULL,
      bva_printed_date text,
      bva_cat_id text NOT NULL,
      bva_overstamped_id integer,
      bva_not_issued integer DEFAULT 0 NOT NULL,
      bva_pri_id integer,
      bva_obverse_color text,
      bva_reverse_color text,
      bva_signature text,
      bva_signature_ext text,
      bva_watermark text,
      bva_security_thread text,
      bva_added_security text,
      bva_is_specimen integer DEFAULT 0 NOT NULL,
      bva_is_commemorative integer DEFAULT 0 NOT NULL,
      bva_is_numis_product integer DEFAULT 0 NOT NULL,
      bva_is_replacement integer DEFAULT 0 NOT NULL,
      bva_is_error integer DEFAULT 0 NOT NULL,
      bva_mintage integer,
      bva_description text
  );
  
  
  ALTER TABLE public.bva_variant OWNER TO #DB_OWNER#;
  
  --
  -- Name: bva_variant_bva_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.bva_variant ALTER COLUMN bva_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.bva_variant_bva_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: con_continent; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.con_continent (
      con_id integer NOT NULL,
      con_name text NOT NULL,
      con_order integer
  );
  
  
  ALTER TABLE public.con_continent OWNER TO #DB_OWNER#;
  
  --
  -- Name: con_continent_con_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.con_continent ALTER COLUMN con_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.con_continent_con_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100
      CACHE 1
  );
  
  
  --
  -- Name: cur_currency; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.cur_currency (
      cur_id integer NOT NULL,
      cur_symbol text,
      cur_name text NOT NULL,
      cur_name_plural text,
      cur_full_name text,
      cur_start text NOT NULL,
      cur_end text,
      cur_successor integer,
      cur_replacement_rate real,
      cur_description text
  );
  
  
  ALTER TABLE public.cur_currency OWNER TO #DB_OWNER#;
  
  --
  -- Name: cur_currency_cur_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.cur_currency ALTER COLUMN cur_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.cur_currency_cur_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: cus_currency_unit; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.cus_currency_unit (
      cus_id integer NOT NULL,
      cus_cur_id integer,
      cus_value real NOT NULL,
      cus_name text NOT NULL,
      cus_name_plural text,
      cus_abbreviation text
  );
  
  
  ALTER TABLE public.cus_currency_unit OWNER TO #DB_OWNER#;
  
  --
  -- Name: cus_currency_unit_cus_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.cus_currency_unit ALTER COLUMN cus_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.cus_currency_unit_cus_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: gra_grade; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.gra_grade (
      gra_value integer NOT NULL,
      gra_grade text NOT NULL,
      gra_name text NOT NULL,
      gra_description text
  );
  
  
  ALTER TABLE public.gra_grade OWNER TO #DB_OWNER#;
  
  --
  -- Name: iss_issuer; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.iss_issuer (
      iss_id integer NOT NULL,
      iss_name text NOT NULL,
      iss_description text,
      iss_ter_id integer
  );
  
  
  ALTER TABLE public.iss_issuer OWNER TO #DB_OWNER#;
  
  --
  -- Name: iss_issuer_iss_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.iss_issuer ALTER COLUMN iss_id ADD GENERATED ALWAYS AS IDENTITY (
      SEQUENCE NAME public.iss_issuer_iss_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: mat_material; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.mat_material (
      mat_id integer NOT NULL,
      mat_name text NOT NULL,
      mat_description text
  );
  
  
  ALTER TABLE public.mat_material OWNER TO #DB_OWNER#;
  
  --
  -- Name: mat_material_mat_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.mat_material ALTER COLUMN mat_id ADD GENERATED ALWAYS AS IDENTITY (
      SEQUENCE NAME public.mat_material_mat_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: pri_printer; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.pri_printer (
      pri_id integer NOT NULL,
      pri_name text NOT NULL,
      pri_location text,
      pri_description text
  );
  
  
  ALTER TABLE public.pri_printer OWNER TO #DB_OWNER#;
  
  --
  -- Name: pri_printer_pri_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.pri_printer ALTER COLUMN pri_id ADD GENERATED ALWAYS AS IDENTITY (
      SEQUENCE NAME public.pri_printer_pri_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: ser_series; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.ser_series (
      ser_id integer NOT NULL,
      ser_cur_id integer NOT NULL,
      ser_name text NOT NULL,
      ser_start integer NOT NULL,
      ser_end integer,
      ser_iss_id integer NOT NULL,
      ser_law_date text,
      ser_description text,
      ser_is_overstamped integer
  );
  
  
  ALTER TABLE public.ser_series OWNER TO #DB_OWNER#;
  
  --
  -- Name: ser_series_ser_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.ser_series ALTER COLUMN ser_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.ser_series_ser_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: tec_territory_currency; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.tec_territory_currency (
      tec_ter_id integer NOT NULL,
      tec_cur_id integer NOT NULL,
      tec_iso3 text,
      tec_cur_type text NOT NULL,
      tec_start text,
      tec_end text,
      tec_is_issuer integer NOT NULL,
      tec_id integer NOT NULL
  );
  
  
  ALTER TABLE public.tec_territory_currency OWNER TO #DB_OWNER#;
  
  --
  -- Name: tec_territory_currency_tec_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.tec_territory_currency ALTER COLUMN tec_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.tec_territory_currency_tec_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: ter_territory; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.ter_territory (
      ter_id integer NOT NULL,
      ter_con_id integer NOT NULL,
      ter_tty_id integer NOT NULL,
      ter_iso2 text,
      ter_iso3 text,
      ter_name text NOT NULL,
      ter_official_name text,
      ter_start integer NOT NULL,
      ter_end integer,
      ter_parent_country_id integer,
      ter_successor_id text,
      ter_description text
  );
  
  
  ALTER TABLE public.ter_territory OWNER TO #DB_OWNER#;
  
  --
  -- Name: ter_territory_ter_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.ter_territory ALTER COLUMN ter_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.ter_territory_ter_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  --
  -- Name: tty_territory_type; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.tty_territory_type (
      tty_id integer NOT NULL,
      tty_name text NOT NULL,
      tty_abbr text,
      tty_desc text,
      tty_order integer
  );
  
  
  ALTER TABLE public.tty_territory_type OWNER TO #DB_OWNER#;
  
  --
  -- Name: tty_territory_type_tty_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.tty_territory_type ALTER COLUMN tty_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.tty_territory_type_tty_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100
      CACHE 1
  );
  
  
  --
  -- Name: usr_user; Type: TABLE; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE TABLE public.usr_user (
      usr_id integer NOT NULL,
      usr_name text NOT NULL
  );
  
  
  ALTER TABLE public.usr_user OWNER TO #DB_OWNER#;
  
  --
  -- Name: usr_user_usr_id_seq; Type: SEQUENCE; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE public.usr_user ALTER COLUMN usr_id ADD GENERATED BY DEFAULT AS IDENTITY (
      SEQUENCE NAME public.usr_user_usr_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      MAXVALUE 100000000
      CACHE 1
  );
  
  
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
  -- INSERT DATA
  
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
  
  --
  -- Name: ban_banknote UNQ_KEY_BANKNOTE; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ban_banknote
      ADD CONSTRAINT "UNQ_KEY_BANKNOTE" UNIQUE (ban_ser_id, ban_cus_id, ban_face_value);
  
  
  --
  -- Name: ban_banknote ban_banknote_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ban_banknote
      ADD CONSTRAINT ban_banknote_pkey PRIMARY KEY (ban_id);
  
  
  --
  -- Name: bit_item bit_item_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bit_item
      ADD CONSTRAINT bit_item_pkey PRIMARY KEY (bit_id);
  
  
  --
  -- Name: bta_banknote_tag bta_banknote_tag_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bta_banknote_tag
      ADD CONSTRAINT bta_banknote_tag_pkey PRIMARY KEY (bta_id);
  
  
  --
  -- Name: bva_variant bva_variant_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bva_variant
      ADD CONSTRAINT bva_variant_pkey PRIMARY KEY (bva_id);
  
  
  --
  -- Name: con_continent con_continent_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.con_continent
      ADD CONSTRAINT con_continent_pkey PRIMARY KEY (con_id);
  
  
  --
  -- Name: cur_currency cur_currency_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.cur_currency
      ADD CONSTRAINT cur_currency_pkey PRIMARY KEY (cur_id);
  
  
  --
  -- Name: cus_currency_unit cus_currency_unit_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.cus_currency_unit
      ADD CONSTRAINT cus_currency_unit_pkey PRIMARY KEY (cus_id);
  
  
  --
  -- Name: gra_grade gra_grade_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.gra_grade
      ADD CONSTRAINT gra_grade_pkey PRIMARY KEY (gra_value);
  
  
  --
  -- Name: iss_issuer iss_issuer_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.iss_issuer
      ADD CONSTRAINT iss_issuer_pkey PRIMARY KEY (iss_id);
  
  
  --
  -- Name: iss_issuer iss_issuer_ukey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.iss_issuer
      ADD CONSTRAINT iss_issuer_ukey UNIQUE (iss_name, iss_ter_id);
  
  
  --
  -- Name: mat_material mat_material_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.mat_material
      ADD CONSTRAINT mat_material_pkey PRIMARY KEY (mat_id);
  
  
  --
  -- Name: pri_printer pri_printer_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.pri_printer
      ADD CONSTRAINT pri_printer_pkey PRIMARY KEY (pri_id);
  
  
  --
  -- Name: ser_series ser_series_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ser_series
      ADD CONSTRAINT ser_series_pkey PRIMARY KEY (ser_id);
  
  
  --
  -- Name: ser_series ser_series_ukey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ser_series
      ADD CONSTRAINT ser_series_ukey UNIQUE (ser_cur_id, ser_name);
  
  
  --
  -- Name: tec_territory_currency tec_territory_currency_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.tec_territory_currency
      ADD CONSTRAINT tec_territory_currency_pkey PRIMARY KEY (tec_id);
  
  
  --
  -- Name: tec_territory_currency tec_territory_currency_ukey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.tec_territory_currency
      ADD CONSTRAINT tec_territory_currency_ukey UNIQUE (tec_ter_id, tec_cur_id, tec_start);
  
  
  --
  -- Name: ter_territory ter_territory_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ter_territory
      ADD CONSTRAINT ter_territory_pkey PRIMARY KEY (ter_id);
  
  
  --
  -- Name: tty_territory_type tty_territory_type_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.tty_territory_type
      ADD CONSTRAINT tty_territory_type_pkey PRIMARY KEY (tty_id);
  
  
  --
  -- Name: usr_user usr_user_pkey; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.usr_user
      ADD CONSTRAINT usr_user_pkey PRIMARY KEY (usr_id);
  
  
  --
  -- Name: usr_user usr_user_usr_name_key; Type: CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.usr_user
      ADD CONSTRAINT usr_user_usr_name_key UNIQUE (usr_name);
  
  
  --
  -- Name: fki_FK_TER_ID; Type: INDEX; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE INDEX "fki_FK_TER_ID" ON public.iss_issuer USING btree (iss_ter_id);
  
  
  --
  -- Name: fki_bva_variant_bva_overstamped_id_fkey; Type: INDEX; Schema: public; Owner: #DB_OWNER#
  --
  
  CREATE INDEX fki_bva_variant_bva_overstamped_id_fkey ON public.bva_variant USING btree (bva_overstamped_id);
  
  
  --
  -- Name: ter_territory FK_CON_ID; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ter_territory
      ADD CONSTRAINT "FK_CON_ID" FOREIGN KEY (ter_con_id) REFERENCES public.con_continent(con_id);
  
  
  --
  -- Name: iss_issuer FK_TER_ID; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.iss_issuer
      ADD CONSTRAINT "FK_TER_ID" FOREIGN KEY (iss_ter_id) REFERENCES public.ter_territory(ter_id);
  
  
  --
  -- Name: ter_territory FK_TTY_ID; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ter_territory
      ADD CONSTRAINT "FK_TTY_ID" FOREIGN KEY (ter_tty_id) REFERENCES public.tty_territory_type(tty_id);
  
  
  --
  -- Name: ban_banknote ban_banknote_ban_cus_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ban_banknote
      ADD CONSTRAINT ban_banknote_ban_cus_id_fkey FOREIGN KEY (ban_cus_id) REFERENCES public.cus_currency_unit(cus_id);
  
  
  --
  -- Name: ban_banknote ban_banknote_ban_mat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ban_banknote
      ADD CONSTRAINT ban_banknote_ban_mat_id_fkey FOREIGN KEY (ban_mat_id) REFERENCES public.mat_material(mat_id);
  
  
  --
  -- Name: ban_banknote ban_banknote_ban_ser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ban_banknote
      ADD CONSTRAINT ban_banknote_ban_ser_id_fkey FOREIGN KEY (ban_ser_id) REFERENCES public.ser_series(ser_id);
  
  
  --
  -- Name: bit_item bit_item_bit_bva_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bit_item
      ADD CONSTRAINT bit_item_bit_bva_id_fkey FOREIGN KEY (bit_bva_id) REFERENCES public.bva_variant(bva_id);
  
  
  --
  -- Name: bta_banknote_tag bta_banknote_tag_bta_ban_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bta_banknote_tag
      ADD CONSTRAINT bta_banknote_tag_bta_ban_id_fkey FOREIGN KEY (bta_ban_id) REFERENCES public.ban_banknote(ban_id);
  
  
  --
  -- Name: bva_variant bva_variant_bva_ban_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bva_variant
      ADD CONSTRAINT bva_variant_bva_ban_id_fkey FOREIGN KEY (bva_ban_id) REFERENCES public.ban_banknote(ban_id);
  
  
  --
  -- Name: bva_variant bva_variant_bva_overstamped_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bva_variant
      ADD CONSTRAINT bva_variant_bva_overstamped_id_fkey FOREIGN KEY (bva_overstamped_id) REFERENCES public.bva_variant(bva_id);
  
  
  --
  -- Name: bva_variant bva_variant_bva_pri_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.bva_variant
      ADD CONSTRAINT bva_variant_bva_pri_id_fkey FOREIGN KEY (bva_pri_id) REFERENCES public.pri_printer(pri_id);
  
  
  --
  -- Name: cus_currency_unit cus_currency_unit_cus_cur_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.cus_currency_unit
      ADD CONSTRAINT cus_currency_unit_cus_cur_id_fkey FOREIGN KEY (cus_cur_id) REFERENCES public.cur_currency(cur_id);
  
  
  --
  -- Name: ser_series ser_series_ser_cur_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ser_series
      ADD CONSTRAINT ser_series_ser_cur_id_fkey FOREIGN KEY (ser_cur_id) REFERENCES public.cur_currency(cur_id);
  
  
  --
  -- Name: ser_series ser_series_ser_iss_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.ser_series
      ADD CONSTRAINT ser_series_ser_iss_id_fkey FOREIGN KEY (ser_iss_id) REFERENCES public.iss_issuer(iss_id);
  
  
  --
  -- Name: tec_territory_currency tec_territory_currency_tec_cur_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.tec_territory_currency
      ADD CONSTRAINT tec_territory_currency_tec_cur_id_fkey FOREIGN KEY (tec_cur_id) REFERENCES public.cur_currency(cur_id);
  
  
  --
  -- Name: tec_territory_currency tec_territory_currency_tec_ter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: #DB_OWNER#
  --
  
  ALTER TABLE ONLY public.tec_territory_currency
      ADD CONSTRAINT tec_territory_currency_tec_ter_id_fkey FOREIGN KEY (tec_ter_id) REFERENCES public.ter_territory(ter_id);
  
  
  --
  -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: #DB_OWNER#
  --
  
  REVOKE ALL ON SCHEMA public FROM rdsadmin;
  REVOKE ALL ON SCHEMA public FROM PUBLIC;
  GRANT ALL ON SCHEMA public TO #DB_OWNER#;
  GRANT ALL ON SCHEMA public TO PUBLIC;
  
  
  --
  -- Name: TABLE ban_banknote; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.ban_banknote TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE bit_item; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.bit_item TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE bta_banknote_tag; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.bta_banknote_tag TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE bva_variant; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.bva_variant TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE con_continent; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.con_continent TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE cur_currency; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.cur_currency TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE cus_currency_unit; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.cus_currency_unit TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE gra_grade; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.gra_grade TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE iss_issuer; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.iss_issuer TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE mat_material; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.mat_material TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE pri_printer; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.pri_printer TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE ser_series; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.ser_series TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE tec_territory_currency; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tec_territory_currency TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE ter_territory; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.ter_territory TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE tty_territory_type; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.tty_territory_type TO "BanknotesAPI";
  
  
  --
  -- Name: TABLE usr_user; Type: ACL; Schema: public; Owner: #DB_OWNER#
  --
  
  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.usr_user TO "BanknotesAPI";
  
  
  