I've recently tried added the strong_migrations gem to my project, but it's preventing me from running any tests because all of the tables in my schema have the force: :cascade
option.
I get the following error when I attempt to run my tests:
bundle exec rake --trace
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
rails aborted!
StrongMigrations::UnsafeMigration:
=== Dangerous operation detected #strong_migrations ===
The force option will destroy existing tables.
If this is intended, drop the existing table first.
Otherwise, remove the force option.
/Users/ekapob/development/positive-sum-tech/friend-tested-jumpstart-pro-rails/db/schema.rb:17:in `block in <main>'
/Users/ekapob/development/positive-sum-tech/friend-tested-jumpstart-pro-rails/db/schema.rb:13:in `<main>'
Tasks: TOP => db:test:load_schema
(See full trace by running task with --trace)
I'm not sure if this is relevant, but I did check the Strong Migrations initializer and the start date is set to after my most recent migration:
config/initializers/strong_migrations.rb
StrongMigrations.start_after = 20220505040931
db/schema.rb
ActiveRecord::Schema[7.0].define(version: 2022_04_26_075339)
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
end
Does anyone know how to resolve this?