From d9eee9bf9a3a3e99acb1cea12082faf0fe8de0f9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 24 Apr 2024 10:56:54 -0400 Subject: [PATCH] Remove column defaults for `status_pins` timestamp columns (#29261) --- ...17171534_remove_defaults_for_status_pins_timestamps.rb | 8 ++++++++ db/schema.rb | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20240217171534_remove_defaults_for_status_pins_timestamps.rb diff --git a/db/migrate/20240217171534_remove_defaults_for_status_pins_timestamps.rb b/db/migrate/20240217171534_remove_defaults_for_status_pins_timestamps.rb new file mode 100644 index 000000000..301371a02 --- /dev/null +++ b/db/migrate/20240217171534_remove_defaults_for_status_pins_timestamps.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class RemoveDefaultsForStatusPinsTimestamps < ActiveRecord::Migration[7.1] + def change + change_column_default :status_pins, :created_at, from: -> { 'CURRENT_TIMESTAMP' }, to: nil + change_column_default :status_pins, :updated_at, from: -> { 'CURRENT_TIMESTAMP' }, to: nil + end +end diff --git a/db/schema.rb b/db/schema.rb index 6a52333a8..a875c6ffc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1030,8 +1030,8 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_22_161611) do create_table "status_pins", force: :cascade do |t| t.bigint "account_id", null: false t.bigint "status_id", null: false - t.datetime "created_at", precision: nil, default: -> { "now()" }, null: false - t.datetime "updated_at", precision: nil, default: -> { "now()" }, null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true t.index ["status_id"], name: "index_status_pins_on_status_id" end