mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Make DSM timestamp columns NOT NULL
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
class AddFieldsToDistributorsShippingMethods < ActiveRecord::Migration
|
||||
def change
|
||||
class DistributorShippingMethod < ActiveRecord::Base
|
||||
self.table_name = "distributors_shipping_methods"
|
||||
end
|
||||
|
||||
def up
|
||||
add_column :distributors_shipping_methods, :id, :primary_key
|
||||
add_column :distributors_shipping_methods, :created_at, :datetime
|
||||
add_column :distributors_shipping_methods, :updated_at, :datetime
|
||||
|
||||
DistributorShippingMethod.reset_column_information
|
||||
DistributorShippingMethod.update_all created_at: Time.now, updated_at: Time.now
|
||||
|
||||
change_column :distributors_shipping_methods, :created_at, :datetime, null: false
|
||||
change_column :distributors_shipping_methods, :updated_at, :datetime, null: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :distributors_shipping_methods, :id
|
||||
remove_column :distributors_shipping_methods, :created_at
|
||||
remove_column :distributors_shipping_methods, :updated_at
|
||||
end
|
||||
end
|
||||
|
||||
@@ -166,8 +166,8 @@ ActiveRecord::Schema.define(:version => 20140702053145) do
|
||||
create_table "distributors_shipping_methods", :force => true do |t|
|
||||
t.integer "distributor_id"
|
||||
t.integer "shipping_method_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "distributors_shipping_methods", ["distributor_id"], :name => "index_distributors_shipping_methods_on_distributor_id"
|
||||
@@ -562,9 +562,9 @@ ActiveRecord::Schema.define(:version => 20140702053145) do
|
||||
t.string "email"
|
||||
t.text "special_instructions"
|
||||
t.integer "distributor_id"
|
||||
t.integer "order_cycle_id"
|
||||
t.string "currency"
|
||||
t.string "last_ip_address"
|
||||
t.integer "order_cycle_id"
|
||||
t.integer "cart_id"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user