From 15d8a8eb84fdea1fcace28973c706883f3050c3c Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sat, 7 Sep 2013 09:50:13 +0200 Subject: [PATCH] Remove useless primary key from line table --- radicale/storage/database.py | 6 +++--- schema.sql | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/radicale/storage/database.py b/radicale/storage/database.py index a23bf9ab..0e40b0a7 100644 --- a/radicale/storage/database.py +++ b/radicale/storage/database.py @@ -78,10 +78,10 @@ class DBLine(Base): """Table of item's lines.""" __tablename__ = "line" - key = Column(String, primary_key=True) + key = Column(String) value = Column(String) - item_name = Column(String, ForeignKey("item.name"), primary_key=True) - timestamp = Column(DateTime, default=datetime.now) + item_name = Column(String, ForeignKey("item.name")) + timestamp = Column(DateTime, default=datetime.now, primary_key=True) item = relationship( "DBItem", backref="lines", order_by=timestamp) diff --git a/schema.sql b/schema.sql index c748e5f6..b6bb8284 100644 --- a/schema.sql +++ b/schema.sql @@ -19,8 +19,7 @@ create table line ( key varchar not null, value varchar not null, item_name varchar references item (name) not null, - timestamp timestamp not null, - primary key (key, value, item_name, timestamp)); + timestamp timestamp not null); create table property ( key varchar not null,