From c6744b49497fca340c8ee5b9913f805ec8ea9be8 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 14 Jun 2016 12:17:41 +0200 Subject: Fixed locking syntax for PostgreSQL --- db/migrate/20160416182152_convert_award_note_to_emoji_award.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db') diff --git a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb index 6d57b796151..95ee03611d9 100644 --- a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb +++ b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb @@ -19,7 +19,7 @@ class ConvertAwardNoteToEmojiAward < ActiveRecord::Migration def migrate_postgresql connection.transaction do - execute 'LOCK notes IN EXCLUSIVE' + execute 'LOCK notes IN EXCLUSIVE MODE' execute "INSERT INTO award_emoji (awardable_type, awardable_id, user_id, name, created_at, updated_at) (SELECT noteable_type, noteable_id, author_id, note, created_at, updated_at FROM notes WHERE is_award = true)" execute "DELETE FROM notes WHERE is_award = true" remove_column :notes, :is_award, :boolean -- cgit v1.2.1