[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1720] trunk/sql/Pg-database.sql



Revision: 1720
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1720&view=rev
Author:   einhverfr
Date:     2007-10-08 10:31:35 -0700 (Mon, 08 Oct 2007)

Log Message:
-----------
Breaking user_preference into a separate table

Modified Paths:
--------------
    trunk/sql/Pg-database.sql

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2007-10-08 05:19:19 UTC (rev 1719)
+++ trunk/sql/Pg-database.sql	2007-10-08 17:31:35 UTC (rev 1720)
@@ -53,13 +53,9 @@
 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 @@
   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,


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.