This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46b4fa3
commit 83c7eaa
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
------------------------------------------------------------------------------- | ||
-- https://github.com/gittip/www.gittip.com/issues/449 | ||
|
||
CREATE TABLE companies | ||
( id bigserial PRIMARY KEY | ||
, brand_id bigint NOT NULL REFERENCES brands | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, voter_id bigint NOT NULL REFERENCES participants.id | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, candidate_id bigint NOT NULL REFERENCES participants.id | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, vote int NOT NULL | ||
); | ||
|
||
CREATE TABLE brands | ||
( id bigserial PRIMARY KEY | ||
, name text NOT NULL | ||
, name_lower text NOT NULL | ||
, url text NOT NULL | ||
, company_id bigint NOT NULL REFERENCES companies | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
); | ||
|
||
CREATE TABLE identifications | ||
( id bigserial PRIMARY KEY | ||
, brand_id bigint NOT NULL REFERENCES brands | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, identifier_id bigint NOT NULL REFERENCES participants.id | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, identified_id bigint NOT NULL REFERENCES participants.id | ||
ON DELETE RESTRICT ON UPDATE RESTRICT | ||
, weight int NOT NULL | ||
); |