summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,