【发布时间】:2017-10-02 00:37:13
【问题描述】:
尝试运行迁移时出错
WARNING: you don't own a lock of type ExclusiveLock
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
迁移看起来像
def up
ActiveRecord::Base.establish_connection
ActiveRecord::Base.connection.execute(
File.read(File.expand_path('setup.sql'))
)
change_column :staff_members, :id, :integer, auto_increment: true
end
sql文件分支到不同的数据库,这个特定的表需要重新定义它的id列就可以了。
【问题讨论】:
-
也许:grokbase.com/t/postgresql/pgsql-hackers/1385ryw0bz/… 有帮助,您需要检查服务器的版本。
标签: ruby-on-rails postgresql migration