Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Modify the schema to record deletions; #586
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Feb 20, 2013
1 parent 7bb790d commit 4969f78
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,21 @@ ALTER TABLE elsewhere ALTER COLUMN participant_id SET NOT NULL;

ALTER TABLE elsewhere ADD CONSTRAINT "elsewhere_platform_participant_id_key"
UNIQUE (platform, participant_id);


-------------------------------------------------------------------------------
-- https://github.com/zetaweb/www.gittip.com/issues/586

CREATE TABLE deletions
( id serial PRIMARY KEY
, timestamp timestamp with time zone NOT NULL
DEFAULT CURRENT_TIMESTAMP

, deleted_was text NOT NULL
-- Not a foreign key! This is soft-immutable.

, archived_as text NOT NULL
REFERENCES participants ON DELETE RESTRICT ON UPDATE RESTRICT
-- UPDATE RESTRICT is a sanity check: noone should be changing
-- participant_ids of deleted accounts.
);

0 comments on commit 4969f78

Please sign in to comment.