1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00
fab-manager/db/migrate/20230728072726_add_ancestry_to_spaces.rb
2023-08-24 14:41:29 +02:00

10 lines
320 B
Ruby

class AddAncestryToSpaces < ActiveRecord::Migration[7.0]
def change
add_column :spaces, :ancestry, :string, collation: 'C'
Space.update_all(ancestry: '/')
change_column_null(:spaces, :ancestry, false)
add_column :spaces, :ancestry_depth, :integer, default: 0
add_index :spaces, :ancestry
end
end