[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1234] trunk/sql/Pg-database.sql
- Subject: SF.net SVN: ledger-smb: [1234] trunk/sql/Pg-database.sql
- From: ..hidden..
- Date: Tue, 22 May 2007 10:02:37 -0700
Revision: 1234
http://svn.sourceforge.net/ledger-smb/?rev=1234&view=rev
Author: linuxpoet
Date: 2007-05-22 10:01:33 -0700 (Tue, 22 May 2007)
Log Message:
-----------
Created authoritative classes for entity_class
Modified Paths:
--------------
trunk/sql/Pg-database.sql
Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql 2007-05-21 17:24:18 UTC (rev 1233)
+++ trunk/sql/Pg-database.sql 2007-05-22 17:01:33 UTC (rev 1234)
@@ -20,20 +20,24 @@
active boolean not null default TRUE);
COMMENT ON TABLE entity_class IS $$ Defines the class type such as vendor, customer, contact, employee $$;
-
+COMMENT ON COLUMN entity_class.id IS $$ The first 7 values are reserved and permanent $$;
+
CREATE UNIQUE index entity_class_unique_idx ON entity_class(lower(class));
COMMENT ON INDEX entity_class_unique_idx IS $$ Helps truly define unique. Which we could do that with Primary Keys $$;
ALTER TABLE entity ADD FOREIGN KEY (entity_class) REFERENCES entity_class(id);
-INSERT INTO entity_class (class) VALUES ('Vendor');
-INSERT INTO entity_class (class) VALUES ('Customer');
-INSERT INTO entity_class (class) VALUES ('Employee');
-INSERT INTO entity_class (class) VALUES ('Contact');
-INSERT INTO entity_class (class) VALUES ('Lead');
-INSERT INTO entity_class (class) VALUES ('Referral');
+INSERT INTO entity_class (id,class) VALUES (1,'Vendor');
+INSERT INTO entity_class (id,class) VALUES (2,'Customer');
+INSERT INTO entity_class (id,class) VALUES (3,'Employee');
+INSERT INTO entity_class (id,class) VALUES (4,'Contact');
+INSERT INTO entity_class (id,class) VALUES (5,'Lead');
+INSERT INTO entity_class (id,class) VALUES (6,'Referral');
+SELECT setval('entity_class_id_seq',7);
+
+
CREATE TABLE country (
id serial PRIMARY KEY,
name text check (name ~ '[[:alnum:]_]') NOT NULL,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.