diff --git a/db/structure.sql b/db/structure.sql index 6369b8f151..f65600cb19 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1494,126 +1494,6 @@ CREATE SEQUENCE catalogs_id_seq ALTER SEQUENCE catalogs_id_seq OWNED BY catalogs.id; --- --- Name: contract_items; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE contract_items ( - id integer NOT NULL, - contract_id integer NOT NULL, - variant_id integer NOT NULL, - quantity numeric(19,4) DEFAULT 1.0 NOT NULL, - unit_pretax_amount numeric(19,4) NOT NULL, - pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - creator_id integer, - updater_id integer, - lock_version integer DEFAULT 0 NOT NULL -); - - --- --- Name: contract_items_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE contract_items_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: contract_items_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE contract_items_id_seq OWNED BY contract_items.id; - - --- --- Name: contract_natures; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE contract_natures ( - id integer NOT NULL, - name character varying NOT NULL, - currency character varying NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - creator_id integer, - updater_id integer, - lock_version integer DEFAULT 0 NOT NULL -); - - --- --- Name: contract_natures_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE contract_natures_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: contract_natures_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE contract_natures_id_seq OWNED BY contract_natures.id; - - --- --- Name: contracts; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE contracts ( - id integer NOT NULL, - nature_id integer NOT NULL, - active boolean DEFAULT false NOT NULL, - name character varying NOT NULL, - number character varying, - description character varying, - state character varying, - reference_number character varying, - started_on date, - stopped_on date, - custom_fields jsonb, - pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL, - currency character varying NOT NULL, - responsible_id integer NOT NULL, - supplier_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - creator_id integer, - updater_id integer, - lock_version integer DEFAULT 0 NOT NULL -); - - --- --- Name: contracts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE contracts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: contracts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE contracts_id_seq OWNED BY contracts.id; - - -- -- Name: crumbs; Type: TABLE; Schema: public; Owner: - -- @@ -2116,8 +1996,7 @@ CREATE TABLE entities ( supplier_payment_delay character varying, bank_account_holder_name character varying, bank_identifier_code character varying, - iban character varying, - supplier_payment_mode_id integer + iban character varying ); @@ -4174,9 +4053,7 @@ CREATE TABLE parcel_items ( product_identification_number character varying, product_name character varying, currency character varying, - unit_pretax_stock_amount numeric(19,4) DEFAULT 0.0 NOT NULL, - unit_pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL, - pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL + unit_pretax_stock_amount numeric(19,4) DEFAULT 0.0 NOT NULL ); @@ -4236,9 +4113,7 @@ CREATE TABLE parcels ( accounted_at timestamp without time zone, currency character varying, journal_entry_id integer, - undelivered_invoice_entry_id integer, - contract_id integer, - pretax_amount numeric(19,4) DEFAULT 0.0 NOT NULL + undelivered_invoice_entry_id integer ); @@ -5445,8 +5320,7 @@ CREATE TABLE purchases ( undelivered_invoice_entry_id integer, quantity_gap_on_invoice_entry_id integer, payment_delay character varying, - payment_at timestamp without time zone, - contract_id integer + payment_at timestamp without time zone ); @@ -6479,27 +6353,6 @@ ALTER TABLE ONLY catalog_items ALTER COLUMN id SET DEFAULT nextval('catalog_item ALTER TABLE ONLY catalogs ALTER COLUMN id SET DEFAULT nextval('catalogs_id_seq'::regclass); --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contract_items ALTER COLUMN id SET DEFAULT nextval('contract_items_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contract_natures ALTER COLUMN id SET DEFAULT nextval('contract_natures_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contracts ALTER COLUMN id SET DEFAULT nextval('contracts_id_seq'::regclass); - - -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- @@ -7497,30 +7350,6 @@ ALTER TABLE ONLY catalogs ADD CONSTRAINT catalogs_pkey PRIMARY KEY (id); --- --- Name: contract_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contract_items - ADD CONSTRAINT contract_items_pkey PRIMARY KEY (id); - - --- --- Name: contract_natures_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contract_natures - ADD CONSTRAINT contract_natures_pkey PRIMARY KEY (id); - - --- --- Name: contracts_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY contracts - ADD CONSTRAINT contracts_pkey PRIMARY KEY (id); - - -- -- Name: crumbs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -9728,139 +9557,6 @@ CREATE INDEX index_catalogs_on_updated_at ON catalogs USING btree (updated_at); CREATE INDEX index_catalogs_on_updater_id ON catalogs USING btree (updater_id); --- --- Name: index_contract_items_on_contract_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_contract_id ON contract_items USING btree (contract_id); - - --- --- Name: index_contract_items_on_created_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_created_at ON contract_items USING btree (created_at); - - --- --- Name: index_contract_items_on_creator_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_creator_id ON contract_items USING btree (creator_id); - - --- --- Name: index_contract_items_on_updated_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_updated_at ON contract_items USING btree (updated_at); - - --- --- Name: index_contract_items_on_updater_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_updater_id ON contract_items USING btree (updater_id); - - --- --- Name: index_contract_items_on_variant_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_items_on_variant_id ON contract_items USING btree (variant_id); - - --- --- Name: index_contract_natures_on_created_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_natures_on_created_at ON contract_natures USING btree (created_at); - - --- --- Name: index_contract_natures_on_creator_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_natures_on_creator_id ON contract_natures USING btree (creator_id); - - --- --- Name: index_contract_natures_on_name; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_natures_on_name ON contract_natures USING btree (name); - - --- --- Name: index_contract_natures_on_updated_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_natures_on_updated_at ON contract_natures USING btree (updated_at); - - --- --- Name: index_contract_natures_on_updater_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contract_natures_on_updater_id ON contract_natures USING btree (updater_id); - - --- --- Name: index_contracts_on_created_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_created_at ON contracts USING btree (created_at); - - --- --- Name: index_contracts_on_creator_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_creator_id ON contracts USING btree (creator_id); - - --- --- Name: index_contracts_on_name; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_name ON contracts USING btree (name); - - --- --- Name: index_contracts_on_nature_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_nature_id ON contracts USING btree (nature_id); - - --- --- Name: index_contracts_on_responsible_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_responsible_id ON contracts USING btree (responsible_id); - - --- --- Name: index_contracts_on_supplier_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_supplier_id ON contracts USING btree (supplier_id); - - --- --- Name: index_contracts_on_updated_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_updated_at ON contracts USING btree (updated_at); - - --- --- Name: index_contracts_on_updater_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_contracts_on_updater_id ON contracts USING btree (updater_id); - - -- -- Name: index_crumbs_on_created_at; Type: INDEX; Schema: public; Owner: - -- @@ -10400,13 +10096,6 @@ CREATE INDEX index_entities_on_responsible_id ON entities USING btree (responsib CREATE INDEX index_entities_on_supplier_account_id ON entities USING btree (supplier_account_id); --- --- Name: index_entities_on_supplier_payment_mode_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_entities_on_supplier_payment_mode_id ON entities USING btree (supplier_payment_mode_id); - - -- -- Name: index_entities_on_updated_at; Type: INDEX; Schema: public; Owner: - -- @@ -12892,13 +12581,6 @@ CREATE INDEX index_parcel_items_on_variant_id ON parcel_items USING btree (varia CREATE INDEX index_parcels_on_address_id ON parcels USING btree (address_id); --- --- Name: index_parcels_on_contract_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_parcels_on_contract_id ON parcels USING btree (contract_id); - - -- -- Name: index_parcels_on_created_at; Type: INDEX; Schema: public; Owner: - -- @@ -14628,13 +14310,6 @@ CREATE INDEX index_purchases_on_accounted_at ON purchases USING btree (accounted CREATE INDEX index_purchases_on_affair_id ON purchases USING btree (affair_id); --- --- Name: index_purchases_on_contract_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_purchases_on_contract_id ON purchases USING btree (contract_id); - - -- -- Name: index_purchases_on_created_at; Type: INDEX; Schema: public; Owner: - -- @@ -16144,10 +15819,6 @@ INSERT INTO schema_migrations (version) VALUES ('20161012145700'); INSERT INTO schema_migrations (version) VALUES ('20161013023259'); -INSERT INTO schema_migrations (version) VALUES ('20161013235101'); - -INSERT INTO schema_migrations (version) VALUES ('20161014191401'); - INSERT INTO schema_migrations (version) VALUES ('20161018162500'); INSERT INTO schema_migrations (version) VALUES ('20161026102134');