From f8a71af4d87d13dc3a518309cace9cf9b7ac155b Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 17 Jun 2016 10:18:24 +0200 Subject: [PATCH] Remove old SQL stuff. --- sql/install/01_init.sql | 178 ------------------ .../0.1-0.2/001_authorized_overdraft.sql | 18 -- sql/update/0.1-0.2/002_pointed.sql | 26 --- sql/update/0.2-0.3/000_placeholder.sql | 16 -- .../0.2-0.3/001_scheduled_operations.sql | 16 -- .../0.2-0.3/002_operation_date_cleanup.sql | 2 - 6 files changed, 256 deletions(-) delete mode 100644 sql/install/01_init.sql delete mode 100644 sql/update/0.1-0.2/001_authorized_overdraft.sql delete mode 100644 sql/update/0.1-0.2/002_pointed.sql delete mode 100644 sql/update/0.2-0.3/000_placeholder.sql delete mode 100644 sql/update/0.2-0.3/001_scheduled_operations.sql delete mode 100644 sql/update/0.2-0.3/002_operation_date_cleanup.sql diff --git a/sql/install/01_init.sql b/sql/install/01_init.sql deleted file mode 100644 index 4c92bb9..0000000 --- a/sql/install/01_init.sql +++ /dev/null @@ -1,178 +0,0 @@ -/* - This file is part of Accountant. - - Accountant is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Accountant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with Accountant. If not, see . - */ - --- --- PostgreSQL database dump --- - -SET statement_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SET check_function_bodies = false; -SET client_min_messages = warning; - --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - -SET search_path = public, pg_catalog; - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- Name: account; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE account ( - id integer NOT NULL, - name character varying(200) NOT NULL, - authorized_overdraft integer DEFAULT 0 NOT NULL -); - - --- --- Name: account_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE account_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: account_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE account_id_seq OWNED BY account.id; - - --- --- Name: entry; Type: TABLE; Schema: public; Owner: -; Tablespace: --- - -CREATE TABLE entry ( - id bigint NOT NULL, - operation_date date, - label character varying(500) NOT NULL, - comment character varying(500), - value numeric(15,2) NOT NULL, - account_id integer NOT NULL, - category character varying(100), - pointed boolean DEFAULT false NOT NULL -); - - --- --- Name: entry_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE entry_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: entry_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE entry_id_seq OWNED BY entry.id; - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY account ALTER COLUMN id SET DEFAULT nextval('account_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY entry ALTER COLUMN id SET DEFAULT nextval('entry_id_seq'::regclass); - - --- --- Name: account_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY account - ADD CONSTRAINT account_pkey PRIMARY KEY (id); - - --- --- Name: entry_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: --- - -ALTER TABLE ONLY entry - ADD CONSTRAINT entry_pkey PRIMARY KEY (id); - - --- --- Name: entry_account_id_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX entry_account_id_idx ON entry USING btree (account_id); - - --- --- Name: entry_operation_date_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX entry_operation_date_idx ON entry USING btree (operation_date); - - --- --- Name: entry_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY entry - ADD CONSTRAINT entry_account_id_fkey FOREIGN KEY (account_id) REFERENCES account(id); - - --- --- Name: public; Type: ACL; Schema: -; Owner: - --- - -REVOKE ALL ON SCHEMA public FROM PUBLIC; -REVOKE ALL ON SCHEMA public FROM postgres; -GRANT ALL ON SCHEMA public TO postgres; -GRANT ALL ON SCHEMA public TO PUBLIC; - - --- --- PostgreSQL database dump complete --- - diff --git a/sql/update/0.1-0.2/001_authorized_overdraft.sql b/sql/update/0.1-0.2/001_authorized_overdraft.sql deleted file mode 100644 index 1adeff3..0000000 --- a/sql/update/0.1-0.2/001_authorized_overdraft.sql +++ /dev/null @@ -1,18 +0,0 @@ -/* - This file is part of Accountant. - - Accountant is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Accountant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with Accountant. If not, see . - */ -ALTER TABLE account ADD COLUMN authorized_overdraft INTEGER NOT NULL DEFAULT 0; - diff --git a/sql/update/0.1-0.2/002_pointed.sql b/sql/update/0.1-0.2/002_pointed.sql deleted file mode 100644 index 2c34b8d..0000000 --- a/sql/update/0.1-0.2/002_pointed.sql +++ /dev/null @@ -1,26 +0,0 @@ -/* - This file is part of Accountant. - - Accountant is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Accountant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with Accountant. If not, see . - */ -ALTER TABLE entry ADD COLUMN pointed BOOLEAN NOT NULL DEFAULT false; - -UPDATE entry SET pointed = operation_date IS NOT NULL; - -UPDATE entry SET operation_date = value_date; - -ALTER TABLE entry DROP COLUMN value_date; - -CREATE INDEX entry_operation_date_idx ON entry USING btree (operation_date); - diff --git a/sql/update/0.2-0.3/000_placeholder.sql b/sql/update/0.2-0.3/000_placeholder.sql deleted file mode 100644 index b995ea8..0000000 --- a/sql/update/0.2-0.3/000_placeholder.sql +++ /dev/null @@ -1,16 +0,0 @@ -/* - This file is part of Accountant. - - Accountant is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Accountant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with Accountant. If not, see . - */ diff --git a/sql/update/0.2-0.3/001_scheduled_operations.sql b/sql/update/0.2-0.3/001_scheduled_operations.sql deleted file mode 100644 index cc025dd..0000000 --- a/sql/update/0.2-0.3/001_scheduled_operations.sql +++ /dev/null @@ -1,16 +0,0 @@ -create table scheduled_operation( - id serial primary key, - start_date date not null, - stop_date date not null, - day integer not null check (day > 0 and day <= 31), - frequency integer not null check (frequency > 0), - label varchar(500) not null, - value numeric(15,2) not null, - account_id integer not null references account(id), - category varchar(100) -); - -create index scheduled_operation_account_id_idx on scheduled_operation(account_id); - -alter table entry add column scheduled_operation_id integer references scheduled_operation(id); - diff --git a/sql/update/0.2-0.3/002_operation_date_cleanup.sql b/sql/update/0.2-0.3/002_operation_date_cleanup.sql deleted file mode 100644 index cd3aa14..0000000 --- a/sql/update/0.2-0.3/002_operation_date_cleanup.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table entry alter column operation_date set not null; -alter table entry drop column comment;