FIX: Remove `null: false` from dropped column (#24)

* FIX: Remove `null: false` from dropped column

It's causing an issue when attempting to seed data in fresh installs.
The column was dropped in a post-migration.

* Update db/migrate/20230322142028_make_dropped_value_column_nullable.rb

Co-authored-by: David Taylor <david@taylorhq.com>

---------

Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
Roman Rizzi 2023-03-22 11:40:20 -03:00 committed by GitHub
parent bd342f538d
commit 1916bafca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
class MakeDroppedValueColumnNullable < ActiveRecord::Migration[7.0]
def up
if column_exists?(:completion_prompts, :value)
Migration::SafeMigrate.disable!
change_column_null :completion_prompts, :value, true
Migration::SafeMigrate.enable!
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end