12 Added notes and colours to customers
This commit is contained in:
5
db/migrate/20250704091649_add_color_to_customers.rb
Normal file
5
db/migrate/20250704091649_add_color_to_customers.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddColorToCustomers < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :customers, :color, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class UpdateExistingCustomersColor < ActiveRecord::Migration[7.1]
|
||||
def up
|
||||
Customer.where(color: nil).update_all(color: 'green')
|
||||
end
|
||||
|
||||
def down
|
||||
# No rollback needed - we don't want to set colors back to nil
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user