KissCount/init.sql

22 lines
2.3 KiB
MySQL
Raw Normal View History

CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255), password VARCHAR(255));
2010-05-17 18:03:21 +02:00
CREATE TABLE account(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), number VARCHAR(255), shared CHAR(1), default_account CHAR(1));
2010-05-16 10:35:34 +02:00
CREATE TABLE account_amount(id INTEGER PRIMARY KEY, account REFERENCES account(id), year INTEGER, month INTEGER, amount INTEGER);
2010-05-16 20:09:18 +02:00
CREATE TABLE operation(id INTEGER PRIMARY KEY, user REFERENCES user(id), account REFERENCES account(id), year INTEGER, month INTEGER, day INTEGER, amount INTEGER, description VARCHAR(255), category REFERENCES preference(id), fix_cost CHAR(1));
CREATE TABLE preference(id INTEGER PRIMARY KEY, user REFERENCES user(id), type VARCHAR(255), name VARCHAR(255), value VARCHAR(255));
CREATE TABLE default_preference(id INTEGER PRIMARY KEY, type VARCHAR(255), name VARCHAR(255), value VARCHAR(255));
INSERT INTO default_preference ("type", "value") VALUES ("category", "Fixe");
INSERT INTO default_preference ("type", "value") VALUES ("category", "Courses");
INSERT INTO default_preference ("type", "value") VALUES ("category", "Loisirs");
INSERT INTO default_preference ("type", "value") VALUES ("category", "Frais de fonctionnement");
2010-05-15 11:21:42 +02:00
INSERT INTO default_preference ("type", "value") VALUES ("category", "Exceptionnel");
2010-05-16 10:35:34 +02:00
-- No password
2010-05-15 11:21:42 +02:00
INSERT INTO user ("id", "name", "password") VALUES ("0", "Greg", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
2010-05-17 18:03:21 +02:00
INSERT INTO account ("id", "user", "name", "number", "shared", "default_account") VALUES ("0", "0", "Compte courant", "000" , "0", "1");
2010-05-16 20:09:18 +02:00
INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost") VALUES ("0", "0", "0", "2010", "0", "0", "1234", "Opé 1", "0", "1");
INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost") VALUES ("1", "0", "0", "2010", "0", "1", "5678", "Opé 2", "1", "0");
INSERT INTO preference ("type", "value") VALUES ("category", "Fixe");
INSERT INTO preference ("type", "value") VALUES ("category", "Courses");
INSERT INTO preference ("type", "value") VALUES ("category", "Loisirs");
INSERT INTO preference ("type", "value") VALUES ("category", "Frais de fonctionnement");
INSERT INTO preference ("type", "value") VALUES ("category", "Exceptionnel");