add back column temporarily to make deployment smoother
This commit is contained in:
parent
b8b4970481
commit
d0d60af510
|
@ -4,3 +4,12 @@ if g = Group.find_by(name: 'trust_level_5', id: 15)
|
|||
end
|
||||
|
||||
Group.where(name: 'everyone').update_all(visibility_level: Group.visibility_levels[:owners])
|
||||
|
||||
ColumnDropper.drop(
|
||||
table: 'groups',
|
||||
after_migration: 'AddVisibleBackToGroups',
|
||||
columns: %w[visible],
|
||||
on_drop: ->(){
|
||||
STDERR.puts 'Removing superflous visible group column!'
|
||||
}
|
||||
)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class AddVisibleBackToGroups < ActiveRecord::Migration
|
||||
def change
|
||||
# add the visible column so it is delay dropped this cleans up some deploy issues
|
||||
add_column :groups, :visible, :boolean, default: true, null: false
|
||||
execute 'UPDATE groups set visible = false where visibility_level > 0'
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue