Remove relationships where source == target prior to adding relationship type
This commit is contained in:
parent
5c9659ccf5
commit
4a1ed5394a
|
@ -2,6 +2,8 @@ class AddTypeToRelationships < ActiveRecord::Migration[5.2]
|
|||
def up
|
||||
add_column :relationships, :type, :string
|
||||
|
||||
execute %(delete from relationships where source_id = target_id)
|
||||
|
||||
execute %(update relationships set type = 'Relationships::Follow')
|
||||
|
||||
change_column_null :relationships, :type, false
|
||||
|
|
Loading…
Reference in New Issue