diff --git a/db/migrate/20220105085729_split_customers_name.rb b/db/migrate/20220105085729_split_customers_name.rb index 7cde6e047d..19c0a3e594 100644 --- a/db/migrate/20220105085729_split_customers_name.rb +++ b/db/migrate/20220105085729_split_customers_name.rb @@ -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 } diff --git a/db/schema.rb b/db/schema.rb index 3fdb1f4cbf..468d478a93 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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