summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 21:14:19 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-05 21:14:19 +0000
commit79ad62faabde1c58e42aac8a10e1d1f0fdb6ed18 (patch)
treed59101b82acf3b5a2bcf6605cd761221f70ae8e5 /sql
parent94903b12ecba837d8717bcf91b7bcc25556a996a (diff)
fix entity/entity_class so you aren't limited to only one customer ever
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1351 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/Pg-database.sql4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index b28c41e7..904dfb27 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -9,8 +9,10 @@ CREATE TABLE transactions (
CREATE TABLE entity (
id serial PRIMARY KEY,
name text check (name ~ '[[:alnum:]_]'),
- entity_class integer not null UNIQUE,
+ entity_class integer not null,
created date not null default current_date);
+
+CREATE UNIQUE INDEX entity_class_name_class_idx ON entity(name,entity_class);
COMMENT ON TABLE entity IS $$ The primary entity table to map to all contacts $$;
COMMENT ON COLUMN entity.name IS $$ This is the common name of an entity. If it was a person it may be Joshua Drake, a company Acme Corp. You may also choose to use a domain such as commandprompt.com $$;