mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add default values for new fields
This commit is contained in:
committed by
Maikel Linke
parent
836a60a6c7
commit
b8afb7ec4d
@@ -3,8 +3,8 @@ class SplitCustomersName < ActiveRecord::Migration[6.1]
|
||||
end
|
||||
|
||||
def change
|
||||
add_column :customers, :first_name, :string
|
||||
add_column :customers, :last_name, :string
|
||||
add_column :customers, :first_name, :string, null: false, default: ""
|
||||
add_column :customers, :last_name, :string, null: false, default: ""
|
||||
rename_column :customers, :name, :backup_name
|
||||
reversible do |dir|
|
||||
dir.up { migrate_customer_name_data }
|
||||
|
||||
@@ -54,8 +54,8 @@ ActiveRecord::Schema.define(version: 2022_01_18_053107) do
|
||||
t.string "backup_name", limit: 255
|
||||
t.boolean "allow_charges", default: false, null: false
|
||||
t.datetime "terms_and_conditions_accepted_at"
|
||||
t.string "first_name"
|
||||
t.string "last_name"
|
||||
t.string "first_name", default: "", null: false
|
||||
t.string "last_name", default: "", null: false
|
||||
t.index ["bill_address_id"], name: "index_customers_on_bill_address_id"
|
||||
t.index ["email"], name: "index_customers_on_email"
|
||||
t.index ["enterprise_id", "code"], name: "index_customers_on_enterprise_id_and_code", unique: true
|
||||
|
||||
Reference in New Issue
Block a user