|
|
|
|
@ -49,23 +49,23 @@ SET default_table_access_method = heap;
|
|
|
|
|
CREATE TABLE public.account (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
number smallint NOT NULL,
|
|
|
|
|
financial_year_id integer NOT NULL,
|
|
|
|
|
"financialYearId" integer NOT NULL,
|
|
|
|
|
description text NOT NULL,
|
|
|
|
|
sru smallint
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: account_balance; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: accountBalance; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.account_balance (
|
|
|
|
|
account_number integer NOT NULL,
|
|
|
|
|
financial_year_id integer NOT NULL,
|
|
|
|
|
CREATE TABLE public."accountBalance" (
|
|
|
|
|
"accountNumber" integer NOT NULL,
|
|
|
|
|
"financialYearId" integer NOT NULL,
|
|
|
|
|
"in" numeric(12,2) DEFAULT 0 NOT NULL,
|
|
|
|
|
"out" numeric(12,2) DEFAULT 0 NOT NULL,
|
|
|
|
|
in_quantity integer,
|
|
|
|
|
out_quantity integer
|
|
|
|
|
"inQuantity" integer,
|
|
|
|
|
"outQuantity" integer
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,21 +90,21 @@ ALTER SEQUENCE public.account_id_seq OWNED BY public.account.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.aliases_to_supplier (
|
|
|
|
|
CREATE TABLE public."aliasesToSupplier" (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
supplier_id integer NOT NULL,
|
|
|
|
|
"supplierId" integer NOT NULL,
|
|
|
|
|
alias text NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.aliases_to_supplier_id_seq
|
|
|
|
|
CREATE SEQUENCE public."aliasesToSupplier_id_seq"
|
|
|
|
|
AS integer
|
|
|
|
|
START WITH 1
|
|
|
|
|
INCREMENT BY 1
|
|
|
|
|
@ -114,10 +114,10 @@ CREATE SEQUENCE public.aliases_to_supplier_id_seq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.aliases_to_supplier_id_seq OWNED BY public.aliases_to_supplier.id;
|
|
|
|
|
ALTER SEQUENCE public."aliasesToSupplier_id_seq" OWNED BY public."aliasesToSupplier".id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -157,12 +157,12 @@ ALTER SEQUENCE public.dimension_id_seq OWNED BY public.dimension.id;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.entry (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
financial_year_id integer NOT NULL,
|
|
|
|
|
journal_id integer NOT NULL,
|
|
|
|
|
"financialYearId" integer NOT NULL,
|
|
|
|
|
"journalId" integer NOT NULL,
|
|
|
|
|
number integer NOT NULL,
|
|
|
|
|
transaction_date date NOT NULL,
|
|
|
|
|
"transactionDate" date NOT NULL,
|
|
|
|
|
description text,
|
|
|
|
|
entry_date date NOT NULL,
|
|
|
|
|
"entryDate" date NOT NULL,
|
|
|
|
|
signature text
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -218,32 +218,32 @@ ALTER SEQUENCE public.file_id_seq OWNED BY public.file.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: files_to_invoice; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: filesToInvoice; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.files_to_invoice (
|
|
|
|
|
invoice_id integer NOT NULL,
|
|
|
|
|
file_id integer NOT NULL
|
|
|
|
|
CREATE TABLE public."filesToInvoice" (
|
|
|
|
|
"invoiceId" integer NOT NULL,
|
|
|
|
|
"fileId" integer NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.financial_year (
|
|
|
|
|
CREATE TABLE public."financialYear" (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
year integer NOT NULL,
|
|
|
|
|
start_date date NOT NULL,
|
|
|
|
|
end_date date NOT NULL
|
|
|
|
|
"startDate" date NOT NULL,
|
|
|
|
|
"endDate" date NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.financial_year_id_seq
|
|
|
|
|
CREATE SEQUENCE public."financialYear_id_seq"
|
|
|
|
|
AS integer
|
|
|
|
|
START WITH 1
|
|
|
|
|
INCREMENT BY 1
|
|
|
|
|
@ -253,10 +253,10 @@ CREATE SEQUENCE public.financial_year_id_seq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.financial_year_id_seq OWNED BY public.financial_year.id;
|
|
|
|
|
ALTER SEQUENCE public."financialYear_id_seq" OWNED BY public."financialYear".id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -265,13 +265,13 @@ ALTER SEQUENCE public.financial_year_id_seq OWNED BY public.financial_year.id;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.invoice (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
financial_year_id integer,
|
|
|
|
|
supplier_id integer NOT NULL,
|
|
|
|
|
fisken_number integer,
|
|
|
|
|
phm_number integer,
|
|
|
|
|
invoice_number text,
|
|
|
|
|
invoice_date date,
|
|
|
|
|
due_date date,
|
|
|
|
|
"financialYearId" integer,
|
|
|
|
|
"supplierId" integer NOT NULL,
|
|
|
|
|
"fiskenNumber" integer,
|
|
|
|
|
"phmNumber" integer,
|
|
|
|
|
"invoiceNumber" text,
|
|
|
|
|
"invoiceDate" date,
|
|
|
|
|
"dueDate" date,
|
|
|
|
|
ocr text,
|
|
|
|
|
amount numeric(12,2)
|
|
|
|
|
);
|
|
|
|
|
@ -334,7 +334,7 @@ ALTER SEQUENCE public.journal_id_seq OWNED BY public.journal.id;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.object (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
dimension_id integer NOT NULL,
|
|
|
|
|
"dimensionId" integer NOT NULL,
|
|
|
|
|
number smallint NOT NULL,
|
|
|
|
|
name text
|
|
|
|
|
);
|
|
|
|
|
@ -367,8 +367,8 @@ ALTER SEQUENCE public.object_id_seq OWNED BY public.object.id;
|
|
|
|
|
CREATE TABLE public.supplier (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
name text,
|
|
|
|
|
supplier_type_id integer NOT NULL,
|
|
|
|
|
tax_id text
|
|
|
|
|
"supplierTypeId" integer NOT NULL,
|
|
|
|
|
"taxId" text
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -393,20 +393,20 @@ ALTER SEQUENCE public.supplier_id_seq OWNED BY public.supplier.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier_type; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplierType; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.supplier_type (
|
|
|
|
|
CREATE TABLE public."supplierType" (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
name text NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier_type_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplierType_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.supplier_type_id_seq
|
|
|
|
|
CREATE SEQUENCE public."supplierType_id_seq"
|
|
|
|
|
AS integer
|
|
|
|
|
START WITH 1
|
|
|
|
|
INCREMENT BY 1
|
|
|
|
|
@ -416,10 +416,10 @@ CREATE SEQUENCE public.supplier_type_id_seq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplierType_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER SEQUENCE public.supplier_type_id_seq OWNED BY public.supplier_type.id;
|
|
|
|
|
ALTER SEQUENCE public."supplierType_id_seq" OWNED BY public."supplierType".id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -428,15 +428,15 @@ ALTER SEQUENCE public.supplier_type_id_seq OWNED BY public.supplier_type.id;
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.transaction (
|
|
|
|
|
id integer NOT NULL,
|
|
|
|
|
entry_id integer NOT NULL,
|
|
|
|
|
account_number smallint NOT NULL,
|
|
|
|
|
"entryId" integer NOT NULL,
|
|
|
|
|
"accountNumber" smallint NOT NULL,
|
|
|
|
|
amount numeric(12,2) NOT NULL,
|
|
|
|
|
object_id integer,
|
|
|
|
|
"objectId" integer,
|
|
|
|
|
description text,
|
|
|
|
|
transaction_date date,
|
|
|
|
|
"transactionDate" date,
|
|
|
|
|
quantity numeric(12,2),
|
|
|
|
|
signature text,
|
|
|
|
|
invoice_id integer
|
|
|
|
|
"invoiceId" integer
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -461,12 +461,12 @@ ALTER SEQUENCE public.transaction_id_seq OWNED BY public.transaction.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transactions_to_objects; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
-- Name: transactionsToObjects; Type: TABLE; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
CREATE TABLE public.transactions_to_objects (
|
|
|
|
|
transaction_id integer NOT NULL,
|
|
|
|
|
object_id integer NOT NULL
|
|
|
|
|
CREATE TABLE public."transactionsToObjects" (
|
|
|
|
|
"transactionId" integer NOT NULL,
|
|
|
|
|
"objectId" integer NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -478,10 +478,10 @@ ALTER TABLE ONLY public.account ALTER COLUMN id SET DEFAULT nextval('public.acco
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.aliases_to_supplier ALTER COLUMN id SET DEFAULT nextval('public.aliases_to_supplier_id_seq'::regclass);
|
|
|
|
|
ALTER TABLE ONLY public."aliasesToSupplier" ALTER COLUMN id SET DEFAULT nextval('public."aliasesToSupplier_id_seq"'::regclass);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -506,10 +506,10 @@ ALTER TABLE ONLY public.file ALTER COLUMN id SET DEFAULT nextval('public.file_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.financial_year ALTER COLUMN id SET DEFAULT nextval('public.financial_year_id_seq'::regclass);
|
|
|
|
|
ALTER TABLE ONLY public."financialYear" ALTER COLUMN id SET DEFAULT nextval('public."financialYear_id_seq"'::regclass);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -541,10 +541,10 @@ ALTER TABLE ONLY public.supplier ALTER COLUMN id SET DEFAULT nextval('public.sup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier_type id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplierType id; Type: DEFAULT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.supplier_type ALTER COLUMN id SET DEFAULT nextval('public.supplier_type_id_seq'::regclass);
|
|
|
|
|
ALTER TABLE ONLY public."supplierType" ALTER COLUMN id SET DEFAULT nextval('public."supplierType_id_seq"'::regclass);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -555,19 +555,19 @@ ALTER TABLE ONLY public.transaction ALTER COLUMN id SET DEFAULT nextval('public.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: account_balance account_balance_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: accountBalance accountBalance_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.account_balance
|
|
|
|
|
ADD CONSTRAINT account_balance_pkey PRIMARY KEY (account_number, financial_year_id);
|
|
|
|
|
ALTER TABLE ONLY public."accountBalance"
|
|
|
|
|
ADD CONSTRAINT "accountBalance_pkey" PRIMARY KEY ("accountNumber", "financialYearId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: account account_number_financial_year_id_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: account account_number_financialYearId_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.account
|
|
|
|
|
ADD CONSTRAINT account_number_financial_year_id_key UNIQUE (number, financial_year_id);
|
|
|
|
|
ADD CONSTRAINT "account_number_financialYearId_key" UNIQUE (number, "financialYearId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -579,19 +579,19 @@ ALTER TABLE ONLY public.account
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier aliases_to_supplier_alias_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier aliasesToSupplier_alias_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.aliases_to_supplier
|
|
|
|
|
ADD CONSTRAINT aliases_to_supplier_alias_key UNIQUE (alias);
|
|
|
|
|
ALTER TABLE ONLY public."aliasesToSupplier"
|
|
|
|
|
ADD CONSTRAINT "aliasesToSupplier_alias_key" UNIQUE (alias);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier aliases_to_supplier_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier aliasesToSupplier_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.aliases_to_supplier
|
|
|
|
|
ADD CONSTRAINT aliases_to_supplier_pkey PRIMARY KEY (id);
|
|
|
|
|
ALTER TABLE ONLY public."aliasesToSupplier"
|
|
|
|
|
ADD CONSTRAINT "aliasesToSupplier_pkey" PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -619,35 +619,35 @@ ALTER TABLE ONLY public.file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: files_to_invoice files_to_invoice_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: filesToInvoice filesToInvoice_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.files_to_invoice
|
|
|
|
|
ADD CONSTRAINT files_to_invoice_pkey PRIMARY KEY (invoice_id, file_id);
|
|
|
|
|
ALTER TABLE ONLY public."filesToInvoice"
|
|
|
|
|
ADD CONSTRAINT "filesToInvoice_pkey" PRIMARY KEY ("invoiceId", "fileId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year financial_year_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear financialYear_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.financial_year
|
|
|
|
|
ADD CONSTRAINT financial_year_pkey PRIMARY KEY (id);
|
|
|
|
|
ALTER TABLE ONLY public."financialYear"
|
|
|
|
|
ADD CONSTRAINT "financialYear_pkey" PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year financial_year_start_date_end_date_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear financialYear_startDate_endDate_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.financial_year
|
|
|
|
|
ADD CONSTRAINT financial_year_start_date_end_date_key UNIQUE (start_date, end_date);
|
|
|
|
|
ALTER TABLE ONLY public."financialYear"
|
|
|
|
|
ADD CONSTRAINT "financialYear_startDate_endDate_key" UNIQUE ("startDate", "endDate");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: financial_year financial_year_year_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: financialYear financialYear_year_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.financial_year
|
|
|
|
|
ADD CONSTRAINT financial_year_year_key UNIQUE (year);
|
|
|
|
|
ALTER TABLE ONLY public."financialYear"
|
|
|
|
|
ADD CONSTRAINT "financialYear_year_key" UNIQUE (year);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -667,11 +667,11 @@ ALTER TABLE ONLY public.journal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: object object_dimension_id_number_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: object object_dimensionId_number_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.object
|
|
|
|
|
ADD CONSTRAINT object_dimension_id_number_key UNIQUE (dimension_id, number);
|
|
|
|
|
ADD CONSTRAINT "object_dimensionId_number_key" UNIQUE ("dimensionId", number);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -691,19 +691,19 @@ ALTER TABLE ONLY public.supplier
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier supplier_tax_id_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplier supplier_taxId_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.supplier
|
|
|
|
|
ADD CONSTRAINT supplier_tax_id_key UNIQUE (tax_id);
|
|
|
|
|
ADD CONSTRAINT "supplier_taxId_key" UNIQUE ("taxId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier_type supplier_type_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplierType supplierType_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.supplier_type
|
|
|
|
|
ADD CONSTRAINT supplier_type_pkey PRIMARY KEY (id);
|
|
|
|
|
ALTER TABLE ONLY public."supplierType"
|
|
|
|
|
ADD CONSTRAINT "supplierType_pkey" PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
@ -715,107 +715,107 @@ ALTER TABLE ONLY public.transaction
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transactions_to_objects transactions_to_objects_transaction_id_object_id_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: transactionsToObjects transactionsToObjects_transactionId_objectId_key; Type: CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transactions_to_objects
|
|
|
|
|
ADD CONSTRAINT transactions_to_objects_transaction_id_object_id_key UNIQUE (transaction_id, object_id);
|
|
|
|
|
ALTER TABLE ONLY public."transactionsToObjects"
|
|
|
|
|
ADD CONSTRAINT "transactionsToObjects_transactionId_objectId_key" UNIQUE ("transactionId", "objectId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: aliases_to_supplier aliases_to_supplier_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: aliasesToSupplier aliasesToSupplier_supplierId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.aliases_to_supplier
|
|
|
|
|
ADD CONSTRAINT aliases_to_supplier_supplier_id_fkey FOREIGN KEY (supplier_id) REFERENCES public.supplier(id);
|
|
|
|
|
ALTER TABLE ONLY public."aliasesToSupplier"
|
|
|
|
|
ADD CONSTRAINT "aliasesToSupplier_supplierId_fkey" FOREIGN KEY ("supplierId") REFERENCES public.supplier(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: files_to_invoice files_to_invoice_file_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: filesToInvoice filesToInvoice_fileId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.files_to_invoice
|
|
|
|
|
ADD CONSTRAINT files_to_invoice_file_id_fkey FOREIGN KEY (file_id) REFERENCES public.file(id);
|
|
|
|
|
ALTER TABLE ONLY public."filesToInvoice"
|
|
|
|
|
ADD CONSTRAINT "filesToInvoice_fileId_fkey" FOREIGN KEY ("fileId") REFERENCES public.file(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: files_to_invoice files_to_invoice_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: filesToInvoice filesToInvoice_invoiceId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.files_to_invoice
|
|
|
|
|
ADD CONSTRAINT files_to_invoice_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.invoice(id);
|
|
|
|
|
ALTER TABLE ONLY public."filesToInvoice"
|
|
|
|
|
ADD CONSTRAINT "filesToInvoice_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES public.invoice(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: invoice invoice_financial_year_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: invoice invoice_financialYearId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.invoice
|
|
|
|
|
ADD CONSTRAINT invoice_financial_year_id_fkey FOREIGN KEY (financial_year_id) REFERENCES public.financial_year(id);
|
|
|
|
|
ADD CONSTRAINT "invoice_financialYearId_fkey" FOREIGN KEY ("financialYearId") REFERENCES public."financialYear"(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: invoice invoice_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: invoice invoice_supplierId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.invoice
|
|
|
|
|
ADD CONSTRAINT invoice_supplier_id_fkey FOREIGN KEY (supplier_id) REFERENCES public.supplier(id);
|
|
|
|
|
ADD CONSTRAINT "invoice_supplierId_fkey" FOREIGN KEY ("supplierId") REFERENCES public.supplier(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: object object_dimension_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: object object_dimensionId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.object
|
|
|
|
|
ADD CONSTRAINT object_dimension_id_fkey FOREIGN KEY (dimension_id) REFERENCES public.dimension(id);
|
|
|
|
|
ADD CONSTRAINT "object_dimensionId_fkey" FOREIGN KEY ("dimensionId") REFERENCES public.dimension(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: supplier supplier_supplier_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: supplier supplier_supplierTypeId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.supplier
|
|
|
|
|
ADD CONSTRAINT supplier_supplier_type_id_fkey FOREIGN KEY (supplier_type_id) REFERENCES public.supplier_type(id);
|
|
|
|
|
ADD CONSTRAINT "supplier_supplierTypeId_fkey" FOREIGN KEY ("supplierTypeId") REFERENCES public."supplierType"(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transaction transaction_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: transaction transaction_entryId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transaction
|
|
|
|
|
ADD CONSTRAINT transaction_entry_id_fkey FOREIGN KEY (entry_id) REFERENCES public.entry(id);
|
|
|
|
|
ADD CONSTRAINT "transaction_entryId_fkey" FOREIGN KEY ("entryId") REFERENCES public.entry(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transaction transaction_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: transaction transaction_invoiceId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transaction
|
|
|
|
|
ADD CONSTRAINT transaction_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.invoice(id);
|
|
|
|
|
ADD CONSTRAINT "transaction_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES public.invoice(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transaction transaction_object_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: transaction transaction_objectId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transaction
|
|
|
|
|
ADD CONSTRAINT transaction_object_id_fkey FOREIGN KEY (object_id) REFERENCES public.object(id);
|
|
|
|
|
ADD CONSTRAINT "transaction_objectId_fkey" FOREIGN KEY ("objectId") REFERENCES public.object(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transactions_to_objects transactions_to_objects_object_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: transactionsToObjects transactionsToObjects_objectId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transactions_to_objects
|
|
|
|
|
ADD CONSTRAINT transactions_to_objects_object_id_fkey FOREIGN KEY (object_id) REFERENCES public.object(id);
|
|
|
|
|
ALTER TABLE ONLY public."transactionsToObjects"
|
|
|
|
|
ADD CONSTRAINT "transactionsToObjects_objectId_fkey" FOREIGN KEY ("objectId") REFERENCES public.object(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Name: transactions_to_objects transactions_to_objects_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
-- Name: "transactionsToObjects" transactionsToObjects_transactionId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
ALTER TABLE ONLY public.transactions_to_objects
|
|
|
|
|
ADD CONSTRAINT transactions_to_objects_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.transaction(id);
|
|
|
|
|
ALTER TABLE ONLY public."transactionsToObjects"
|
|
|
|
|
ADD CONSTRAINT "transactionsToObjects_transactionId_fkey" FOREIGN KEY ("transactionId") REFERENCES public.transaction(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
|