diff --git a/db/migrate/20240221004332_fix_default_value_for_modeling_logs_created_at.rb b/db/migrate/20240221004332_fix_default_value_for_modeling_logs_created_at.rb new file mode 100644 index 00000000..668b315a --- /dev/null +++ b/db/migrate/20240221004332_fix_default_value_for_modeling_logs_created_at.rb @@ -0,0 +1,12 @@ +class FixDefaultValueForModelingLogsCreatedAt < ActiveRecord::Migration[7.1] + def change + # NOTE: This isn't a field used in the Rails app; it's one used in Impress + # 2020, and when we imported the latest schema into here, the importer + # didn't correctly capture the default field it uses. + # + # So, this is just us fixing the dev environment as declared by `schema.rb` + # to match how things already are in prod! + change_column_default :modeling_logs, :created_at, + from: nil, to: -> { "CURRENT_TIMESTAMP" } + end +end diff --git a/db/schema.rb b/db/schema.rb index e54e690d..cde7ddb4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_02_20_230420) do +ActiveRecord::Schema[7.1].define(version: 2024_02_21_004332) do create_table "alt_styles", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "species_id", null: false t.integer "color_id", null: false @@ -162,7 +162,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_20_230420) do end create_table "modeling_logs", id: :integer, charset: "latin1", collation: "latin1_swedish_ci", force: :cascade do |t| - t.datetime "created_at", precision: nil, null: false + t.datetime "created_at", precision: nil, default: -> { "current_timestamp()" }, null: false t.text "log_json", null: false t.string "pet_name", limit: 128, null: false end