CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255), password VARCHAR(255));
CREATE TABLE account(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), number VARCHAR(255), shared CHAR(1), default CHAR(1));
CREATE TABLE operation(id INTEGER PRIMARY KEY, account REFERENCES account(id), year INTEGER, month INTEGER, day INTEGER, description VARCHAR(255), category VARCHAR(255), 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");
INSERT INTO default_preference ("type", "value") VALUES ("category", "Exceptionnel");