Show
Ignore:
Timestamp:
05/09/08 12:31:09 (2 months ago)
Author:
dbs
Message:

Make all foreign keys deferrable, so we can DELETE and INSERT inside a transaction without constraints hobbling us

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Open-ILS/src/sql/Pg/080.schema.money.sql

    r7945 r9542  
    77CREATE TABLE money.collections_tracker ( 
    88        id              BIGSERIAL                       PRIMARY KEY, 
    9         usr             INT                             NOT NULL REFERENCES actor.usr (id), -- actor.usr.id 
    10         collector       INT                             NOT NULL REFERENCES actor.usr (id), 
    11         location        INT                             NOT NULL REFERENCES actor.org_unit (id), 
     9        usr             INT                             NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, -- actor.usr.id 
     10        collector       INT                             NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED, 
     11        location        INT                             NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED, 
    1212        enter_time      TIMESTAMP WITH TIME ZONE 
    1313); 
     
    325325 
    326326CREATE TABLE money.bnm_desk_payment ( 
    327         cash_drawer     INT     REFERENCES actor.workstation (id) 
     327        cash_drawer     INT     REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED 
    328328) INHERITS (money.bnm_payment); 
    329329ALTER TABLE money.bnm_desk_payment ADD PRIMARY KEY (id);