Maintenance: Redo column allow signup with reset column information to make the migration work. Removed old migration because of missing column information reset there was a quite crash.
This commit is contained in:
parent
cf5a5e3960
commit
317c7b7e7f
2 changed files with 7 additions and 3 deletions
|
@ -1,10 +1,14 @@
|
||||||
class RoleSignupColumn < ActiveRecord::Migration[5.2]
|
class RoleSignupColumnFix < ActiveRecord::Migration[5.2]
|
||||||
def change
|
def change
|
||||||
|
|
||||||
# return if it's a new setup
|
# return if it's a new setup
|
||||||
return if !Setting.exists?(name: 'system_init_done')
|
return if !Setting.exists?(name: 'system_init_done')
|
||||||
|
|
||||||
add_column :permissions, :allow_signup, :boolean, null: false, default: false
|
if !column_exists?(:permissions, :allow_signup)
|
||||||
|
add_column :permissions, :allow_signup, :boolean, null: false, default: false
|
||||||
|
end
|
||||||
|
|
||||||
|
Permission.reset_column_information
|
||||||
|
|
||||||
signup_permissions = [
|
signup_permissions = [
|
||||||
'user_preferences',
|
'user_preferences',
|
|
@ -1,6 +1,6 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
RSpec.describe RoleSignupColumn, type: :db_migration, db_strategy: :reset do
|
RSpec.describe RoleSignupColumnFix, type: :db_migration, db_strategy: :reset do
|
||||||
context 'when a role contains signup permissions' do
|
context 'when a role contains signup permissions' do
|
||||||
let!(:role) do
|
let!(:role) do
|
||||||
role = create(:role)
|
role = create(:role)
|
||||||
|
|
Loading…
Reference in a new issue