Skip to content

Commit

Permalink
Add foreign key migrations support
Browse files Browse the repository at this point in the history
Close #174
  • Loading branch information
tagliala committed Jul 24, 2022
1 parent 426c71a commit 812bf56
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/chrono_model/adapter/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ def remove_column(table_name, column_name, type = nil, **options)
drop_and_recreate_public_view(table_name) { super }
end

def add_foreign_key(table_name, *)
return super unless is_chrono?(table_name)
on_temporal_schema { super }
end

def remove_foreign_key(table_name, *)
return super unless is_chrono?(table_name)
on_temporal_schema { super }
end

private
# In destructive changes, such as removing columns or changing column
# types, the view must be dropped and recreated, while the change has
Expand Down

0 comments on commit 812bf56

Please sign in to comment.