]> cat aescling's git repositories - mastodon.git/commitdiff
Update model annotations to use BIGINT for IDs (#5461)
authorDaniel Hunsaker <danhunsaker@gmail.com>
Sun, 12 Nov 2017 15:18:50 +0000 (08:18 -0700)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 12 Nov 2017 15:18:50 +0000 (16:18 +0100)
All the migrations have been updated to use BIGINTs for ID fields in the DB, but ActiveRecord needs to be told to treat those values as BIGINT as well. This PR does that.

30 files changed:
app/models/account.rb
app/models/account_domain_block.rb
app/models/account_moderation_note.rb
app/models/block.rb
app/models/conversation.rb
app/models/conversation_mute.rb
app/models/custom_emoji.rb
app/models/domain_block.rb
app/models/email_domain_block.rb
app/models/favourite.rb
app/models/follow.rb
app/models/follow_request.rb
app/models/import.rb
app/models/media_attachment.rb
app/models/mention.rb
app/models/mute.rb
app/models/notification.rb
app/models/preview_card.rb
app/models/report.rb
app/models/session_activation.rb
app/models/setting.rb
app/models/site_upload.rb
app/models/status.rb
app/models/status_pin.rb
app/models/stream_entry.rb
app/models/subscription.rb
app/models/tag.rb
app/models/user.rb
app/models/web/push_subscription.rb
app/models/web/setting.rb

index 7e4d29f96ee4dfe522b163ea72a532b8ebacd4a5..6f6010f7af13b05783ae0775fc73e85b8872b819 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: accounts
 #
-#  id                      :integer          not null, primary key
+#  id                      :bigint           not null, primary key
 #  username                :string           default(""), not null
 #  domain                  :string
 #  secret                  :string           default(""), not null
index fb695e473e4e7d2f432bb92fc84ed448663569a4..9c98ec2a6fc2c74a6d10b7ebd30bf5d7be3778ce 100644 (file)
@@ -6,8 +6,8 @@
 #  domain     :string
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
-#  account_id :integer
-#  id         :integer          not null, primary key
+#  account_id :bigint
+#  id         :bigint           not null, primary key
 #
 
 class AccountDomainBlock < ApplicationRecord
index 3ac9b1ac1424bf5fe3a9c50cf4d3f0266a40bb7f..06f464850c549d0f2075b5f351018261ce7f42ef 100644 (file)
@@ -3,10 +3,10 @@
 #
 # Table name: account_moderation_notes
 #
-#  id                :integer          not null, primary key
+#  id                :bigint           not null, primary key
 #  content           :text             not null
-#  account_id        :integer          not null
-#  target_account_id :integer          not null
+#  account_id        :bigint           not null
+#  target_account_id :bigint           not null
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
 #
index a913782eddcd0335fcc52833bb6508b046b3d36d..5778f7e90ba05e0ede26b02393d1acafe11a4217 100644 (file)
@@ -5,9 +5,9 @@
 #
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
-#  account_id        :integer          not null
-#  id                :integer          not null, primary key
-#  target_account_id :integer          not null
+#  account_id        :bigint           not null
+#  id                :bigint           not null, primary key
+#  target_account_id :bigint           not null
 #
 
 class Block < ApplicationRecord
index 08c1ce945897828a9a6a2375ad7a42cbbc3d1768..e08532522577669501cb4bb3d97cf93fb83e4653 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: conversations
 #
-#  id         :integer          not null, primary key
+#  id         :bigint           not null, primary key
 #  uri        :string
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
index 8d2399adf52918e2fb701d40c4a3303db3b9d6a0..316865bd27d6e9dc61e8a69f328d54d7b7629f2f 100644 (file)
@@ -3,9 +3,9 @@
 #
 # Table name: conversation_mutes
 #
-#  conversation_id :integer          not null
-#  account_id      :integer          not null
-#  id              :integer          not null, primary key
+#  conversation_id :bigint           not null
+#  account_id      :bigint           not null
+#  id              :bigint           not null, primary key
 #
 
 class ConversationMute < ApplicationRecord
index a77b53c98b35c62c0f2f40d85c8b3b3f801f4ca4..5723ebd5db707296bd0909a34862450e7bc5fe2a 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: custom_emojis
 #
-#  id                 :integer          not null, primary key
+#  id                 :bigint           not null, primary key
 #  shortcode          :string           default(""), not null
 #  domain             :string
 #  image_file_name    :string
index 1268290bc0c4e25ba6eddf8202e0e4bf5f7ac07d..557d0a19c79a43dc1d26fafaeaf3f338afccd907 100644 (file)
@@ -8,7 +8,7 @@
 #  updated_at   :datetime         not null
 #  severity     :integer          default("silence")
 #  reject_media :boolean          default(FALSE), not null
-#  id           :integer          not null, primary key
+#  id           :bigint           not null, primary key
 #
 
 class DomainBlock < ApplicationRecord
index 839038bea6d3c7f182c3df55f572be15c9150624..51410605bdde06aa65b9fb41bde1a7ecf9294c43 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: email_domain_blocks
 #
-#  id         :integer          not null, primary key
+#  id         :bigint           not null, primary key
 #  domain     :string           not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
index d28d5c05b935e5df4a3f8f424854cb068ed30850..f611aa6a99e28df07c4dec10bf9ab687fa58c23a 100644 (file)
@@ -5,9 +5,9 @@
 #
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
-#  account_id :integer          not null
-#  id         :integer          not null, primary key
-#  status_id  :integer          not null
+#  account_id :bigint           not null
+#  id         :bigint           not null, primary key
+#  status_id  :bigint           not null
 #
 
 class Favourite < ApplicationRecord
index 667720a88f314fecdf32af6d12a7ba3e3ab543ac..3d5447fb1f050aeb649c1bc3a9f56e1943b7e2fa 100644 (file)
@@ -5,9 +5,9 @@
 #
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
-#  account_id        :integer          not null
-#  id                :integer          not null, primary key
-#  target_account_id :integer          not null
+#  account_id        :bigint           not null
+#  id                :bigint           not null, primary key
+#  target_account_id :bigint           not null
 #
 
 class Follow < ApplicationRecord
index 458bcd28a8ad8caead1da3b69a7260c87315eb6b..ce27fc92149c81d879560c2ff3444bc5e37b6ed0 100644 (file)
@@ -5,9 +5,9 @@
 #
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
-#  account_id        :integer          not null
-#  id                :integer          not null, primary key
-#  target_account_id :integer          not null
+#  account_id        :bigint           not null
+#  id                :bigint           not null, primary key
+#  target_account_id :bigint           not null
 #
 
 class FollowRequest < ApplicationRecord
index 8ae7e3a46f8f0f23eb843e4c75301149084c598e..6f127855660043a9c13831185490b311c2d43fdc 100644 (file)
@@ -11,8 +11,8 @@
 #  data_content_type :string
 #  data_file_size    :integer
 #  data_updated_at   :datetime
-#  account_id        :integer          not null
-#  id                :integer          not null, primary key
+#  account_id        :bigint           not null
+#  id                :bigint           not null, primary key
 #
 
 class Import < ApplicationRecord
index 60380198b34e2c4422c5ca82f3303eccaa272264..f054189255100acf3f6f4ed1d520ce07d0f156b9 100644 (file)
@@ -3,14 +3,14 @@
 #
 # Table name: media_attachments
 #
-#  id                :integer          not null, primary key
-#  status_id         :integer
+#  id                :bigint           not null, primary key
+#  status_id         :bigint
 #  file_file_name    :string
 #  file_content_type :string
 #  file_file_size    :integer
 #  file_updated_at   :datetime
 #  remote_url        :string           default(""), not null
-#  account_id        :integer
+#  account_id        :bigint
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
 #  shortcode         :string
index 3700c781c8c97ebc8cce07d105ebed15336a1a31..fc089d365931e42cfd4693ef82878bc85951eec8 100644 (file)
@@ -3,11 +3,11 @@
 #
 # Table name: mentions
 #
-#  status_id  :integer
+#  status_id  :bigint
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
-#  account_id :integer
-#  id         :integer          not null, primary key
+#  account_id :bigint
+#  id         :bigint           not null, primary key
 #
 
 class Mention < ApplicationRecord
index 6e64848c7661c6fc05bb00f4c9c939479d8444f2..4174a35234cc4f968142c3404ea4a3617550239a 100644 (file)
@@ -5,9 +5,9 @@
 #
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
-#  account_id        :integer          not null
-#  id                :integer          not null, primary key
-#  target_account_id :integer          not null
+#  account_id        :bigint           not null
+#  id                :bigint           not null, primary key
+#  target_account_id :bigint           not null
 #
 
 class Mute < ApplicationRecord
index 0a5d987cfec84cf9d782545c270b0f3c148dd54b..c88af9021b11c07db642aa35dfefe2f4c7469535 100644 (file)
@@ -3,13 +3,13 @@
 #
 # Table name: notifications
 #
-#  id              :integer          not null, primary key
-#  account_id      :integer
-#  activity_id     :integer
+#  id              :bigint           not null, primary key
+#  account_id      :bigint
+#  activity_id     :bigint
 #  activity_type   :string
 #  created_at      :datetime         not null
 #  updated_at      :datetime         not null
-#  from_account_id :integer
+#  from_account_id :bigint
 #
 
 class Notification < ApplicationRecord
index e2bf65d94776659e5af4c81c03ef4befe26ab45a..63c04b410e4e93f5e61ba1ce8cd4df62d8291414 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: preview_cards
 #
-#  id                 :integer          not null, primary key
+#  id                 :bigint           not null, primary key
 #  url                :string           default(""), not null
 #  title              :string           default(""), not null
 #  description        :string           default(""), not null
index bffb42b481f33a166db689fe239f2245345958aa..99c90b7dd2a8012ed98d962ca03578d048bed5e9 100644 (file)
@@ -8,10 +8,10 @@
 #  action_taken               :boolean          default(FALSE), not null
 #  created_at                 :datetime         not null
 #  updated_at                 :datetime         not null
-#  account_id                 :integer          not null
-#  action_taken_by_account_id :integer
-#  id                         :integer          not null, primary key
-#  target_account_id          :integer          not null
+#  account_id                 :bigint           not null
+#  action_taken_by_account_id :bigint
+#  id                         :bigint           not null, primary key
+#  target_account_id          :bigint           not null
 #
 
 class Report < ApplicationRecord
index c1645223bda233786566c85a81763af70140bade..59565f8775a019ac27e52da7af034e73a21157eb 100644 (file)
@@ -3,25 +3,25 @@
 #
 # Table name: session_activations
 #
-#  id                       :integer          not null, primary key
-#  user_id                  :integer          not null
+#  id                       :bigint           not null, primary key
+#  user_id                  :bigint           not null
 #  session_id               :string           not null
 #  created_at               :datetime         not null
 #  updated_at               :datetime         not null
 #  user_agent               :string           default(""), not null
 #  ip                       :inet
-#  access_token_id          :integer
-#  web_push_subscription_id :integer
+#  access_token_id          :bigint
+#  web_push_subscription_id :bigint
 #
 
-#  id              :integer          not null, primary key
-#  user_id         :integer          not null
+#  id              :bigint           not null, primary key
+#  user_id         :bigint           not null
 #  session_id      :string           not null
 #  created_at      :datetime         not null
 #  updated_at      :datetime         not null
 #  user_agent      :string           default(""), not null
 #  ip              :inet
-#  access_token_id :integer
+#  access_token_id :bigint
 #
 
 class SessionActivation < ApplicationRecord
index a14f156a1e77d50caadfa870a922f07afc0fced7..be68d3123b3145aa0ba47a9c6d42756e012e6872 100644 (file)
@@ -8,8 +8,8 @@
 #  thing_type :string
 #  created_at :datetime
 #  updated_at :datetime
-#  id         :integer          not null, primary key
-#  thing_id   :integer
+#  id         :bigint           not null, primary key
+#  thing_id   :bigint
 #
 
 class Setting < RailsSettings::Base
index 8ffdc831313ad93cd61bbacdabee8697ca3a6693..ba2ca777b888bdd8c585c905829d291f17c53baa 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: site_uploads
 #
-#  id                :integer          not null, primary key
+#  id                :bigint           not null, primary key
 #  var               :string           default(""), not null
 #  file_file_name    :string
 #  file_content_type :string
index 5a72456135e366328870e8ddf2bffad0988fd66f..b4f314311788489048d60e080e30d69479b0bd09 100644 (file)
@@ -3,25 +3,25 @@
 #
 # Table name: statuses
 #
-#  id                     :integer          not null, primary key
+#  id                     :bigint           not null, primary key
 #  uri                    :string
-#  account_id             :integer          not null
+#  account_id             :bigint           not null
 #  text                   :text             default(""), not null
 #  created_at             :datetime         not null
 #  updated_at             :datetime         not null
-#  in_reply_to_id         :integer
-#  reblog_of_id           :integer
+#  in_reply_to_id         :bigint
+#  reblog_of_id           :bigint
 #  url                    :string
 #  sensitive              :boolean          default(FALSE), not null
 #  visibility             :integer          default("public"), not null
-#  in_reply_to_account_id :integer
-#  application_id         :integer
+#  in_reply_to_account_id :bigint
+#  application_id         :bigint
 #  spoiler_text           :text             default(""), not null
 #  reply                  :boolean          default(FALSE), not null
 #  favourites_count       :integer          default(0), not null
 #  reblogs_count          :integer          default(0), not null
 #  language               :string
-#  conversation_id        :integer
+#  conversation_id        :bigint
 #  local                  :boolean
 #
 
index a72c19750ebd4b79ef9827cba3798f1531411eca..5795d07bf987cdad5dde88edb8b855cc46244141 100644 (file)
@@ -3,9 +3,9 @@
 #
 # Table name: status_pins
 #
-#  id         :integer          not null, primary key
-#  account_id :integer          not null
-#  status_id  :integer          not null
+#  id         :bigint           not null, primary key
+#  account_id :bigint           not null
+#  status_id  :bigint           not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
 #
index b51fe9ad76d07beae5a31ce1401fe526f484eae1..50b900c3cbb1e694bc092ec5872194a45e09b109 100644 (file)
@@ -3,13 +3,13 @@
 #
 # Table name: stream_entries
 #
-#  activity_id   :integer
+#  activity_id   :bigint
 #  activity_type :string
 #  created_at    :datetime         not null
 #  updated_at    :datetime         not null
 #  hidden        :boolean          default(FALSE), not null
-#  account_id    :integer
-#  id            :integer          not null, primary key
+#  account_id    :bigint
+#  id            :bigint           not null, primary key
 #
 
 class StreamEntry < ApplicationRecord
index 39860196b2c0a6db76b50fef9b52094c3d72f886..bc50c53176505e5227b4d8b5b4d8c29e464776ec 100644 (file)
@@ -11,8 +11,8 @@
 #  updated_at                  :datetime         not null
 #  last_successful_delivery_at :datetime
 #  domain                      :string
-#  account_id                  :integer          not null
-#  id                          :integer          not null, primary key
+#  account_id                  :bigint           not null
+#  id                          :bigint           not null, primary key
 #
 
 class Subscription < ApplicationRecord
index 0fa08e157c831d224dec5e67349751af2440f698..6ebaf1145958ed0f187b2a8e09037c136b52e011 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: tags
 #
-#  id         :integer          not null, primary key
+#  id         :bigint           not null, primary key
 #  name       :string           default(""), not null
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
index 9022e6ea8ce884da9bf4232d19ee1d510fc633f8..ebe768c523ec0eb3439674804f35a0cf00cdb162 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: users
 #
-#  id                        :integer          not null, primary key
+#  id                        :bigint           not null, primary key
 #  email                     :string           default(""), not null
 #  created_at                :datetime         not null
 #  updated_at                :datetime         not null
@@ -30,7 +30,7 @@
 #  last_emailed_at           :datetime
 #  otp_backup_codes          :string           is an Array
 #  filtered_languages        :string           default([]), not null, is an Array
-#  account_id                :integer          not null
+#  account_id                :bigint           not null
 #  disabled                  :boolean          default(FALSE), not null
 #  moderator                 :boolean          default(FALSE), not null
 #
index cb15dfa3703de38a5bfc27d6066bd0975fb919ee..da67e7665332c3d03e8e9485bebb0c3db00f63c5 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Table name: web_push_subscriptions
 #
-#  id         :integer          not null, primary key
+#  id         :bigint           not null, primary key
 #  endpoint   :string           not null
 #  key_p256dh :string           not null
 #  key_auth   :string           not null
index 1b0bfb2b7b54121b129e26eeb8c9f13014c3ca7e..6d08c4d35531337147dc726b6ae8e10f9265232b 100644 (file)
@@ -6,8 +6,8 @@
 #  data       :json
 #  created_at :datetime         not null
 #  updated_at :datetime         not null
-#  id         :integer          not null, primary key
-#  user_id    :integer
+#  id         :bigint           not null, primary key
+#  user_id    :bigint
 #
 
 class Web::Setting < ApplicationRecord