瀏覽代碼

Make some migration script more robust (fixes #8007) (#8170)

Include a dummy Account class in the migration script containing only the
attributes relevant to the migration in order to not rely as much on the
codebase being in sync with the database schema.
master
ThibG 5 年之前
committed by Eugen Rochko
父節點
當前提交
cbc2e6bd40
共有 1 個檔案被更改,包括 9 行新增0 行删除
  1. +9
    -0
      db/migrate/20180528141303_fix_accounts_unique_index.rb

+ 9
- 0
db/migrate/20180528141303_fix_accounts_unique_index.rb 查看文件

@@ -1,4 +1,13 @@
class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
class Account < ApplicationRecord
# Dummy class, to make migration possible across version changes
has_one :user, inverse_of: :account

def local?
domain.nil?
end
end

disable_ddl_transaction!

def up


Loading…
取消
儲存