summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-08 17:31:35 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-08 17:31:35 +0000
commit8639d83105801a2d231faa9ee103a17d8a748a19 (patch)
tree99baf188f349f97c855e4771962388756047083a /sql
parent2ebce93bdbcde34ce45fd06aece8d18572d882c5 (diff)
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
Diffstat (limited to 'sql')
-rw-r--r--sql/Pg-database.sql21
1 files changed, 15 insertions, 6 deletions
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,