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

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



Revision: 1228
          http://svn.sourceforge.net/ledger-smb/?rev=1228&view=rev
Author:   linuxpoet
Date:     2007-05-20 14:20:11 -0700 (Sun, 20 May 2007)

Log Message:
-----------
rebuild oe references and add oe_class table

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

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2007-05-20 21:05:05 UTC (rev 1227)
+++ trunk/sql/Pg-database.sql	2007-05-20 21:20:11 UTC (rev 1228)
@@ -351,8 +351,7 @@
   id serial PRIMARY KEY,
   ordnumber text,
   transdate date default current_date,
-  vendor_id int,
-  customer_id int,
+  entity_id integer references entity(id) NOT NULL,
   amount NUMERIC,
   netamount NUMERIC,
   reqdate date,
@@ -370,10 +369,19 @@
   language_code varchar(6),
   ponumber text,
   terms int2 DEFAULT 0
+  oe_class_id int references oe_type(id) NOT NULL
 );
 
---- Chris, we need to talk about oe and the relationship between customer_id and vendor_id
+CREATE TABLE oe_class (
+  id smallint unique check(id IN (1,2),
+  oe_class text primary key;
+  
+INSERT INTO oe_class(id,oe_class) values (1,'Sales Order');
+INSERT INTO oe_class(id,oe_class) values (2,'Purchase Order');
 
+COMMENT ON TABLE oe_class IS $$ This could probably be done better. But I need to remove the customer_id/vendor_id relationship and instead rely on a classification $$;
+
+
 --
 CREATE TABLE orderitems (
   id int serial PRIMARY KEY,


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