[deploy] Optimization:Change Tweet Primary Key to Bigint (#9409)
This commit is contained in:
parent
e3455ef921
commit
d79a2133f7
2 changed files with 15 additions and 2 deletions
13
db/migrate/20200720213710_change_tweet_p_kto_bigint.rb
Normal file
13
db/migrate/20200720213710_change_tweet_p_kto_bigint.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class ChangeTweetPKtoBigint < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
safety_assured {
|
||||
change_column :tweets, :id, :bigint
|
||||
}
|
||||
end
|
||||
|
||||
def down
|
||||
safety_assured {
|
||||
change_column :tweets, :id, :int
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
@ -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_143134) do
|
||||
ActiveRecord::Schema.define(version: 2020_07_20_213710) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -1080,7 +1080,7 @@ ActiveRecord::Schema.define(version: 2020_07_20_143134) do
|
|||
t.index ["social_preview_template"], name: "index_tags_on_social_preview_template"
|
||||
end
|
||||
|
||||
create_table "tweets", id: :serial, force: :cascade do |t|
|
||||
create_table "tweets", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.text "extended_entities_serialized", default: "--- {}\n"
|
||||
t.integer "favorite_count"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue