Skip to content

Commit

Permalink
Make all co-authors own the paper
Browse files Browse the repository at this point in the history
  • Loading branch information
KinanBab committed May 23, 2023
1 parent e524006 commit 9456d27
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions experiments/schema-annot/annotated/hotcrp-annotated.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- not supported by k9db:
-- not supported by k9db:
-- col types varbinary, blob, varchar
-- multi column primary keys
-- multi column primary keys
-- auto increment
-- default values
-- KEY / UNIQUE KEY
Expand Down Expand Up @@ -90,11 +90,34 @@ CREATE TABLE Paper (
-- KEY shepherdContactId (shepherdContactId),
FOREIGN KEY (paperStorageId) REFERENCES PaperStorage(paperStorageId),
FOREIGN KEY (finalPaperStorageId) REFERENCES PaperStorage(paperStorageId),
FOREIGN KEY (leadContactId) OWNED_BY ContactInfo(contactId),
FOREIGN KEY (leadContactId) REFERENCES ONLY ContactInfo(contactId),
FOREIGN KEY (shepherdContactId) ACCESSED_BY ContactInfo(contactId),
FOREIGN KEY (managerContactId) ACCESSED_BY ContactInfo(contactId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Added this table to work around issue #172.
-- Extracts co-author conflictType from PaperConflict
CREATE TABLE PaperAuthors (
id int PRIMARY KEY NOT NULL,
paperId int NOT NULL,
contactId int NOT NULL,
FOREIGN KEY (paperId) OWNS Paper(paperId),
FOREIGN KEY (contactId) OWNED_BY ContactInfo(contactId)
)

CREATE TABLE PaperConflict (
id int PRIMARY KEY NOT NULL,
paperId int NOT NULL,
contactId int NOT NULL,
conflictType int NOT NULL,
FOREIGN KEY (paperId) ACCESSED_BY Paper(paperId),
-- see issue #172: ownership/edge in data ownership graph dependent on column value of conflictType,
-- which could be co-author, institutional, etc.
FOREIGN KEY (contactId) OWNED_BY ContactInfo(contactId),
ON DEL (paperId) DELETE_ROW
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE ActionLog (
logId int NOT NULL,
contactId int NOT NULL,
Expand Down Expand Up @@ -203,26 +226,6 @@ CREATE TABLE PaperComment (
FOREIGN KEY (contactId) OWNED_BY ContactInfo(contactId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE PaperConflict (
id int PRIMARY KEY NOT NULL,
paperId int NOT NULL,
contactId int NOT NULL,
conflictType int NOT NULL,
FOREIGN KEY (paperId) REFERENCES Paper(paperId)
-- see issue #172: ownership/edge in data ownership graph dependent on column value of conflictType,
-- which could be co-author, institutional, etc.
-- FOREIGN KEY (contactId) REFERENCES ContactInfo(contactId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Added this table to work around issue #172. Extracts co-author conflictType from PaperConflict
CREATE TABLE PaperAuthors (
id int PRIMARY KEY NOT NULL,
paperId int NOT NULL,
contactId int NOT NULL,
FOREIGN KEY (paperId) REFERENCES Paper(paperId),
FOREIGN KEY (contactId) OWNED_BY ContactInfo(contactId)
)

CREATE TABLE PaperOption (
id int PRIMARY KEY NOT NULL,
paperId int NOT NULL,
Expand Down Expand Up @@ -333,7 +336,7 @@ CREATE TABLE PaperTag (

CREATE TABLE PaperTagAnno (
-- # case-insensitive; see TAG_MAXLEN in init.php
tag text NOT NULL,
tag text NOT NULL,
annoId int NOT NULL,
tagIndex int NOT NULL,
heading text,
Expand Down Expand Up @@ -410,4 +413,4 @@ CREATE TABLE TopicInterest (
FOREIGN KEY (topicId) REFERENCES TopicArea(topicId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

EXPLAIN COMPLIANCE;
EXPLAIN COMPLIANCE;

0 comments on commit 9456d27

Please sign in to comment.