diff --git a/lib/chrono_model/adapter/migrations.rb b/lib/chrono_model/adapter/migrations.rb index f8e8ec43..be7f6226 100644 --- a/lib/chrono_model/adapter/migrations.rb +++ b/lib/chrono_model/adapter/migrations.rb @@ -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