From 8639d83105801a2d231faa9ee103a17d8a748a19 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 8 Oct 2007 17:31:35 +0000 Subject: Breaking user_preference into a separate table git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1720 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/Pg-database.sql | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'sql') diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index dc22e135..345908b0 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -53,13 +53,9 @@ COMMENT ON TABLE entity_class_to_entity IS $$ Relation builder for classes to en CREATE TABLE users ( id serial UNIQUE, username varchar(30) primary key, - entity_id int not null references employee(entity_id) on delete cascade, - language text references country(short_name), - stylesheet text default 'ledgersmb.css' not null, - printer text, - dateformat text default 'yyyy-mm-dd' not null, - numberformat text default '1000.00' not null + entity_id int not null references entity(id) on delete cascade, ); + COMMENT ON TABLE users IS $$username is the actual primary key here because we do not want duplicate users$$; create table user_connection ( @@ -983,6 +979,19 @@ CREATE TABLE translation ( PRIMARY KEY (trans_id, language_code) ); -- +CREATE TABLE user_preference ( + user_id int PRIMARY KEY REFERENCES users(id), + language varchar(6) REFERENCES language(code), + stylesheet text default 'ledgersmb.css' not null, + printer text, + dateformat text default 'yyyy-mm-dd' not null, + numberformat text default '1000.00' not null +); + +-- user_preference is here due to a dependency on language.code +COMMENT ON TABLE user_preference IS +$$ This table sets the basic preferences for formats, languages, printers, and user-selected stylesheets.$$; + CREATE TABLE recurring ( id int DEFAULT nextval ( 'id' ) PRIMARY KEY, reference text, -- cgit v1.2.3