diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-28 17:54:14 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-28 17:54:14 +0000 |
commit | 3f2d74280d593cf4abcd1b6d385f408f1cf3045c (patch) | |
tree | 7861f11b7dedf049ffaad3658b1a4179207274ba /sql/Pg-database.sql | |
parent | 9e9e218cf6f65aeeaf1366ce1a67fc7dfbc1dedc (diff) |
Allowing multiple payment vouchers per batch per invoice. Test cases added
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2380 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/Pg-database.sql')
-rw-r--r-- | sql/Pg-database.sql | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index e606d81b..41775a39 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -491,12 +491,14 @@ CREATE TABLE batch ( COMMENT ON COLUMN batch.batch_class_id IS $$ Note that this field is largely used for sorting the vouchers. A given batch is NOT restricted to this type.$$; + +-- Although I am moving the primary key to voucher.id for now, as of 1.4, I +-- would expect trans_id to be primary key CREATE TABLE voucher ( trans_id int REFERENCES transactions(id) NOT NULL, batch_id int references batch(id) not null, - id serial NOT NULL unique, - batch_class int references batch_class(id) not null, - PRIMARY KEY (batch_class, batch_id, trans_id) + id serial PRIMARY KEY, + batch_class int references batch_class(id) not null ); COMMENT ON COLUMN voucher.batch_class IS $$ This is the authoritative class of the |