Skip to content

Commit

Permalink
models: primary key fix
Browse files Browse the repository at this point in the history
* Fixes issue with primary key on SIPFile model.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
  • Loading branch information
lnielsen committed Jun 7, 2016
1 parent a6d3bdb commit 0ddbc4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions invenio_sipstore/models.py
Expand Up @@ -117,17 +117,17 @@ class SIPFile(db.Model, Timestamp):

__tablename__ = 'sipstore_sipfile'

sip_id = db.Column(UUIDType, db.ForeignKey(SIP.id))
sip_id = db.Column(UUIDType, db.ForeignKey(SIP.id), primary_key=True)
"""Id of SIP."""

filepath = db.Column(
db.Text().with_variant(mysql.VARCHAR(255), 'mysql'), nullable=False)
db.Text().with_variant(mysql.VARCHAR(255), 'mysql'), nullable=False,
primary_key=True)
"""Filepath of submitted file within the SIP record."""

file_id = db.Column(
UUIDType,
db.ForeignKey(FileInstance.id, ondelete='RESTRICT'),
primary_key=True,
nullable=False)
"""Id of the FileInstance."""

Expand Down

0 comments on commit 0ddbc4a

Please sign in to comment.