Fixed recurring purchase entry
This commit is contained in:
parent
79324ff5f7
commit
d937e64663
19 changed files with 7421 additions and 2 deletions
43
share/ddl/SQLite/upgrade/26-27/001-auto.sql
Normal file
43
share/ddl/SQLite/upgrade/26-27/001-auto.sql
Normal file
|
@ -0,0 +1,43 @@
|
|||
-- Convert schema 'share/ddl/_source/deploy/26/001-auto.yml' to 'share/ddl/_source/deploy/27/001-auto.yml':;
|
||||
|
||||
;
|
||||
BEGIN;
|
||||
|
||||
;
|
||||
CREATE TEMPORARY TABLE transaction_recurring_temp_alter (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
transaction_id integer NOT NULL,
|
||||
recurring_period varchar(255) NOT NULL,
|
||||
FOREIGN KEY (transaction_id) REFERENCES transactions(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
;
|
||||
INSERT INTO transaction_recurring_temp_alter( id, transaction_id, recurring_period) SELECT id, transaction_id, recurring_period FROM transaction_recurring;
|
||||
|
||||
;
|
||||
DROP TABLE transaction_recurring;
|
||||
|
||||
;
|
||||
CREATE TABLE transaction_recurring (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
transaction_id integer NOT NULL,
|
||||
recurring_period varchar(255) NOT NULL,
|
||||
FOREIGN KEY (transaction_id) REFERENCES transactions(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
;
|
||||
CREATE INDEX transaction_recurring_idx_t00 ON transaction_recurring (transaction_id);
|
||||
|
||||
;
|
||||
CREATE UNIQUE INDEX transaction_recurring_trans00 ON transaction_recurring (transaction_id);
|
||||
|
||||
;
|
||||
INSERT INTO transaction_recurring SELECT id, transaction_id, recurring_period FROM transaction_recurring_temp_alter;
|
||||
|
||||
;
|
||||
DROP TABLE transaction_recurring_temp_alter;
|
||||
|
||||
;
|
||||
|
||||
COMMIT;
|
||||
|
Reference in a new issue