interchange / interchange6-schema

DBIC schema for Interchange 6
8 stars 7 forks source link

Relationship between payment_orders and sessions #155

Closed murwiz closed 9 years ago

murwiz commented 9 years ago

My version of the schema may be out of date, but I have this:

TABLE "payment_orders" CONSTRAINT "payment_orders_fk_sessions_id" FOREIGN KEY (sessions_id) REFERENCES sessions(sessions_id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE

That's actually awkward, as it means you can never expire old sessions, or the associated payment row disappears, too. I believe this should be:

TABLE "payment_orders" CONSTRAINT "payment_orders_fk_sessions_id" FOREIGN KEY (sessions_id) REFERENCES sessions(sessions_id) ON UPDATE CASCADE ON DELETE SET NULL DEFERRABLE
murwiz commented 9 years ago

Oh, and if that suggestion is taken:

sessions_id | character varying(255) | not null

We must remove the "not null" constraint here.

SysPete commented 9 years ago

Closed by 012ba545 on 5th Oct 2014.