Fix some old migration scripts (#17394)

* Fix some old migration scripts

* Fix edge case in two-step migration from older releases
This commit is contained in:
Claire 2022-01-30 21:38:54 +01:00 committed by GitHub
parent f5639e1cbe
commit ac583fce21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 4 deletions

View file

@ -1,4 +1,9 @@
class AddInstanceActor < ActiveRecord::Migration[5.2]
class Account < ApplicationRecord
# Dummy class, to make migration possible across version changes
validates :username, uniqueness: { scope: :domain, case_sensitive: false }
end
def up
Account.create!(id: -99, actor_type: 'Application', locked: true, username: Rails.configuration.x.local_domain)
end