mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Remove NULL possibility from customer flag
It should only be true or false. This was flagged by Rubocop. I also added another Rubocop suggestion and combined two migrations because they are related.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddCreatedManuallyFlagToCustomer < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :customers, :created_manually, :boolean, default: false
|
||||
add_column :customers, :created_manually, :boolean, null: false, default: false
|
||||
add_index :customers, :created_manually
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
class AddIndexToCustomers < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_index :customers, :created_manually
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_05_31_010957) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_06_05_133804) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "plpgsql"
|
||||
@@ -93,7 +93,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_05_31_010957) do
|
||||
t.datetime "terms_and_conditions_accepted_at", precision: nil
|
||||
t.string "first_name", default: "", null: false
|
||||
t.string "last_name", default: "", null: false
|
||||
t.boolean "created_manually", default: false
|
||||
t.boolean "created_manually", default: false, null: false
|
||||
t.index ["bill_address_id"], name: "index_customers_on_bill_address_id"
|
||||
t.index ["created_manually"], name: "index_customers_on_created_manually"
|
||||
t.index ["email"], name: "index_customers_on_email"
|
||||
|
||||
Reference in New Issue
Block a user