From d82916c0f2a9092ea67b6ce60aef9aee8cea598c Mon Sep 17 00:00:00 2001 From: cavis Date: Tue, 30 Apr 2024 11:37:13 -0600 Subject: [PATCH] Non-null lock_versions --- db/migrate/20240424214558_add_locking_columns.rb | 6 +++--- db/schema.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db/migrate/20240424214558_add_locking_columns.rb b/db/migrate/20240424214558_add_locking_columns.rb index 0b684f7ed..b5ce8d090 100644 --- a/db/migrate/20240424214558_add_locking_columns.rb +++ b/db/migrate/20240424214558_add_locking_columns.rb @@ -1,7 +1,7 @@ class AddLockingColumns < ActiveRecord::Migration[7.0] def change - add_column :episodes, :lock_version, :integer - add_column :feeds, :lock_version, :integer - add_column :podcasts, :lock_version, :integer + add_column :episodes, :lock_version, :integer, null: false, default: 0 + add_column :feeds, :lock_version, :integer, null: false, default: 0 + add_column :podcasts, :lock_version, :integer, null: false, default: 0 end end diff --git a/db/schema.rb b/db/schema.rb index df346da87..f43b108cc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -164,7 +164,7 @@ t.integer "segment_count" t.text "production_notes" t.integer "medium" - t.integer "lock_version" + t.integer "lock_version", default: 0, null: false t.index ["guid"], name: "index_episodes_on_guid", unique: true t.index ["keyword_xid"], name: "index_episodes_on_keyword_xid", unique: true t.index ["original_guid", "podcast_id"], name: "index_episodes_on_original_guid_and_podcast_id", unique: true, where: "((deleted_at IS NULL) AND (original_guid IS NOT NULL))" @@ -229,7 +229,7 @@ t.boolean "include_donation_url", default: true t.text "exclude_tags" t.datetime "deleted_at", precision: nil - t.integer "lock_version" + t.integer "lock_version", default: 0, null: false t.index ["podcast_id", "slug"], name: "index_feeds_on_podcast_id_and_slug", unique: true, where: "(slug IS NOT NULL)" t.index ["podcast_id"], name: "index_feeds_on_podcast_id" t.index ["podcast_id"], name: "index_feeds_on_podcast_id_default", unique: true, where: "(slug IS NULL)" @@ -357,7 +357,7 @@ t.text "restrictions" t.string "payment_pointer" t.string "donation_url" - t.integer "lock_version" + t.integer "lock_version", default: 0, null: false t.index ["path"], name: "index_podcasts_on_path", unique: true t.index ["prx_uri"], name: "index_podcasts_on_prx_uri", unique: true t.index ["source_url"], name: "index_podcasts_on_source_url", unique: true, where: "((deleted_at IS NULL) AND (source_url IS NOT NULL))"