Files
next-transactions/src/main/resources/data-h2.sql
T

30 lines
1.9 KiB
SQL

INSERT INTO User (id, name) VALUES (1, 'Tilman'), (2, 'Anica');
INSERT INTO Account (id, name, owner_id) VALUES (1, 'Gemeinschaftskonto', 1), (2, 'Konto Tilman', 1);
INSERT INTO Category (id, name, account_id, position) VALUES (1, 'Essen - Lebensmittel', 1, 2), (2, 'Einnahmen - Gehalt', 1, 1), (3, 'Essen - Arbeit', 1, 3), (4, 'Einnahmen - Gehalt', 2, 1), (5, 'Technik - Server und Hosting', 2, 2);
INSERT INTO Account_User (account_id, user_id) VALUES (1, 1), (1, 2), (2, 1);
INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES
(NULL, 1280.81, 1, 1, '2014-06-01', 'Gehalt', null),
(NULL, -2.21, 1, 2, '2014-06-10', 'Brot', null),
(NULL, -3.41, 1, 2, '2014-06-12', 'Gemüse', null),
(NULL, -7.81, 1, 3, '2014-06-19', 'Kantine', null),
(NULL, -4.81, 1, 3, '2014-06-18', 'Currywurst', 1),
(NULL, -4.50, 1, 3, '2014-06-19', 'Currywurst', null),
(NULL, -4.50, 1, 3, '2014-06-20', 'Currywurst', null),
(NULL, -4.50, 2, 3, '2014-06-20', 'Currywurst', null),
(NULL, -4.09, 1, 3, '2014-06-18', 'Currywurst-Frühstück', null),
(NULL, -4.90, 1, 3, '2014-06-18', 'Currywurst (Auslage Anica)', 2),
(NULL, -8.90, 1, 3, '2014-06-18', 'Curry beim Inder (Auslage Tilman)', 1),
(NULL, -12.00, 2, 3, '2014-06-18', 'Curry Thai', null),
(NULL, 1340.22, 2, 4, '2014-06-02', 'Gehalt Tilman', null),
(NULL, -12.90, 2, 5, '2014-06-16', 'Host Europe', null);
-- add as many transactions as needed
INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 2, CURRENT_TIMESTAMP(), 'Transaction', null); Commit;
INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, CURRENT_TIMESTAMP(), 'Transaction', null); Commit;
INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, 1.50, 1, 4, CURRENT_TIMESTAMP()+1, 'LAST Transaction', null); Commit;