[Pypi-checkins] r792 - in trunk/pypi: . tools
martin.von.loewis
python-checkins at python.org
Sat Jul 24 12:58:20 CEST 2010
Author: martin.von.loewis
Date: Sat Jul 24 12:58:20 2010
New Revision: 792
Added:
trunk/pypi/tools/sql-migrate-20100724.sql
Modified:
trunk/pypi/pkgbase_schema.sql
Log:
Follow pkgbase change to change ratings primary
key. Restore unique constraint.
Modified: trunk/pypi/pkgbase_schema.sql
==============================================================================
--- trunk/pypi/pkgbase_schema.sql (original)
+++ trunk/pypi/pkgbase_schema.sql Sat Jul 24 12:58:20 2010
@@ -331,6 +331,7 @@
user_name TEXT REFERENCES users ON DELETE CASCADE,
date TIMESTAMP,
rating INTEGER,
+ UNIQUE(name,version,user_name),
FOREIGN KEY (name, version) REFERENCES releases ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE INDEX rating_name_version ON ratings(name, version);
Added: trunk/pypi/tools/sql-migrate-20100724.sql
==============================================================================
--- (empty file)
+++ trunk/pypi/tools/sql-migrate-20100724.sql Sat Jul 24 12:58:20 2010
@@ -0,0 +1,5 @@
+begin;
+alter table ratings drop constraint ratings_pkey;
+alter table ratings add primary key (id);
+alter table ratings add unique(name,version,user_name);
+end;
\ No newline at end of file
More information about the Pypi-checkins
mailing list