diff --git a/migrations/004.location-date-size-like.up.sql b/migrations/004.location-date-size-like.up.sql index 9e41aad1..391e6275 100644 --- a/migrations/004.location-date-size-like.up.sql +++ b/migrations/004.location-date-size-like.up.sql @@ -84,6 +84,3 @@ CREATE TABLE IF NOT EXISTS building_user_likes ( ); CREATE INDEX building_likes_idx ON building_user_likes ( building_id ); CREATE INDEX user_likes_idx ON building_user_likes ( user_id ); - --- One like per-building, per-user --- ALTER TABLE building_user_likes ADD CONSTRAINT building_like_once UNIQUE (building_id, user_id); diff --git a/migrations/005.limit-likes.down.sql b/migrations/005.limit-likes.down.sql new file mode 100644 index 00000000..96a4261e --- /dev/null +++ b/migrations/005.limit-likes.down.sql @@ -0,0 +1,2 @@ +-- Don't limit likes +ALTER TABLE building_user_likes DROP CONSTRAINT building_like_once; diff --git a/migrations/005.limit-likes.up.sql b/migrations/005.limit-likes.up.sql new file mode 100644 index 00000000..3581b2f2 --- /dev/null +++ b/migrations/005.limit-likes.up.sql @@ -0,0 +1,2 @@ +-- One like per-building, per-user +ALTER TABLE building_user_likes ADD CONSTRAINT building_like_once UNIQUE (building_id, user_id);