[deploy] Optimization:Change Podcast and Episode PKs to Bigints (#9423)

This commit is contained in:
Molly Struve 2020-07-22 09:15:10 -05:00 committed by GitHub
parent 126367fa4a
commit b6cc3ebb9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 4 deletions

View file

@ -0,0 +1,17 @@
class ChangePodcastPKstoBigint < ActiveRecord::Migration[6.0]
def up
safety_assured {
change_column :podcasts, :id, :bigint
change_column :podcast_episodes, :id, :bigint
change_column :podcast_episodes, :podcast_id, :bigint
}
end
def down
safety_assured {
change_column :podcasts, :id, :int
change_column :podcast_episodes, :id, :int
change_column :podcast_episodes, :podcast_id, :int
}
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_07_20_213710) do
ActiveRecord::Schema.define(version: 2020_07_21_213341) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -823,7 +823,7 @@ ActiveRecord::Schema.define(version: 2020_07_20_213710) do
t.index ["slug"], name: "index_pages_on_slug", unique: true
end
create_table "podcast_episodes", id: :serial, force: :cascade do |t|
create_table "podcast_episodes", force: :cascade do |t|
t.boolean "any_comments_hidden", default: false
t.text "body"
t.integer "comments_count", default: 0, null: false
@ -834,7 +834,7 @@ ActiveRecord::Schema.define(version: 2020_07_20_213710) do
t.string "image"
t.string "itunes_url"
t.string "media_url", null: false
t.integer "podcast_id"
t.bigint "podcast_id"
t.text "processed_html"
t.datetime "published_at"
t.text "quote"
@ -855,7 +855,7 @@ ActiveRecord::Schema.define(version: 2020_07_20_213710) do
t.index ["website_url"], name: "index_podcast_episodes_on_website_url"
end
create_table "podcasts", id: :serial, force: :cascade do |t|
create_table "podcasts", force: :cascade do |t|
t.string "android_url"
t.datetime "created_at", null: false
t.integer "creator_id"