13f5952336
The migrations could no longer be applied on an empty database, mainly because they referred to models that no longer existed. Replaced the model references with direct table access that will always be correct at the time the migration is applied. Also removed conflicting indexes in table renames.
12 lines
295 B
Ruby
12 lines
295 B
Ruby
class AddProjectToBubbles < ActiveRecord::Migration[8.0]
|
|
def change
|
|
change_table :bubbles do |t|
|
|
t.references :project, null: true
|
|
end
|
|
|
|
execute "update bubbles set project_id = (select id from projects limit 1)"
|
|
|
|
change_column_null :bubbles, :project_id, false
|
|
end
|
|
end
|