From 79ad62faabde1c58e42aac8a10e1d1f0fdb6ed18 Mon Sep 17 00:00:00 2001 From: linuxpoet Date: Thu, 5 Jul 2007 21:14:19 +0000 Subject: 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 --- sql/Pg-database.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sql') 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 $$; -- cgit v1.2.3