about summary refs log tree commit diff
path: root/db/migrate/20170918125918_ids_to_bigints.rb
blob: 7483dd77a44f453444390ad7cd2d48edc13cb842 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
class IdsToBigints < ActiveRecord::Migration[5.1]
  def up
    change_column :account_domain_blocks, :account_id, :bigint
    change_column :account_domain_blocks, :id, :bigint
    change_column :accounts, :id, :bigint
    change_column :blocks, :account_id, :bigint
    change_column :blocks, :id, :bigint
    change_column :blocks, :target_account_id, :bigint
    change_column :conversation_mutes, :account_id, :bigint
    change_column :conversation_mutes, :id, :bigint
    change_column :deprecated_preview_cards, :id, :bigint if table_exists?(:deprecated_preview_cards)
    change_column :domain_blocks, :id, :bigint
    change_column :favourites, :account_id, :bigint
    change_column :favourites, :id, :bigint
    change_column :favourites, :status_id, :bigint
    change_column :follow_requests, :account_id, :bigint
    change_column :follow_requests, :id, :bigint
    change_column :follow_requests, :target_account_id, :bigint
    change_column :follows, :account_id, :bigint
    change_column :follows, :id, :bigint
    change_column :follows, :target_account_id, :bigint
    change_column :imports, :account_id, :bigint
    change_column :imports, :id, :bigint
    change_column :media_attachments, :account_id, :bigint
    change_column :media_attachments, :id, :bigint
    change_column :mentions, :account_id, :bigint
    change_column :mentions, :id, :bigint
    change_column :mutes, :account_id, :bigint
    change_column :mutes, :id, :bigint
    change_column :mutes, :target_account_id, :bigint
    change_column :notifications, :account_id, :bigint
    change_column :notifications, :from_account_id, :bigint
    change_column :notifications, :id, :bigint
    change_column :oauth_access_grants, :application_id, :bigint
    change_column :oauth_access_grants, :id, :bigint
    change_column :oauth_access_grants, :resource_owner_id, :bigint
    change_column :oauth_access_tokens, :application_id, :bigint
    change_column :oauth_access_tokens, :id, :bigint
    change_column :oauth_access_tokens, :resource_owner_id, :bigint
    change_column :oauth_applications, :id, :bigint
    change_column :oauth_applications, :owner_id, :bigint
    change_column :reports, :account_id, :bigint
    change_column :reports, :action_taken_by_account_id, :bigint
    change_column :reports, :id, :bigint
    change_column :reports, :target_account_id, :bigint
    change_column :session_activations, :access_token_id, :bigint
    change_column :session_activations, :user_id, :bigint
    change_column :session_activations, :web_push_subscription_id, :bigint
    change_column :settings, :id, :bigint
    change_column :settings, :thing_id, :bigint
    change_column :statuses, :account_id, :bigint
    change_column :statuses, :application_id, :bigint
    change_column :statuses, :in_reply_to_account_id, :bigint
    change_column :stream_entries, :account_id, :bigint
    change_column :stream_entries, :id, :bigint
    change_column :subscriptions, :account_id, :bigint
    change_column :subscriptions, :id, :bigint
    change_column :tags, :id, :bigint
    change_column :users, :account_id, :bigint
    change_column :users, :id, :bigint
    change_column :web_settings, :id, :bigint
    change_column :web_settings, :user_id, :bigint
  end

  def down
    change_column :account_domain_blocks, :account_id, :integer
    change_column :account_domain_blocks, :id, :integer
    change_column :accounts, :id, :integer
    change_column :blocks, :account_id, :integer
    change_column :blocks, :id, :integer
    change_column :blocks, :target_account_id, :integer
    change_column :conversation_mutes, :account_id, :integer
    change_column :conversation_mutes, :id, :integer
    change_column :deprecated_preview_cards, :id, :integer if table_exists?(:deprecated_preview_cards)
    change_column :domain_blocks, :id, :integer
    change_column :favourites, :account_id, :integer
    change_column :favourites, :id, :integer
    change_column :favourites, :status_id, :integer
    change_column :follow_requests, :account_id, :integer
    change_column :follow_requests, :id, :integer
    change_column :follow_requests, :target_account_id, :integer
    change_column :follows, :account_id, :integer
    change_column :follows, :id, :integer
    change_column :follows, :target_account_id, :integer
    change_column :imports, :account_id, :integer
    change_column :imports, :id, :integer
    change_column :media_attachments, :account_id, :integer
    change_column :media_attachments, :id, :integer
    change_column :mentions, :account_id, :integer
    change_column :mentions, :id, :integer
    change_column :mutes, :account_id, :integer
    change_column :mutes, :id, :integer
    change_column :mutes, :target_account_id, :integer
    change_column :notifications, :account_id, :integer
    change_column :notifications, :from_account_id, :integer
    change_column :notifications, :id, :integer
    change_column :oauth_access_grants, :application_id, :integer
    change_column :oauth_access_grants, :id, :integer
    change_column :oauth_access_grants, :resource_owner_id, :integer
    change_column :oauth_access_tokens, :application_id, :integer
    change_column :oauth_access_tokens, :id, :integer
    change_column :oauth_access_tokens, :resource_owner_id, :integer
    change_column :oauth_applications, :id, :integer
    change_column :oauth_applications, :owner_id, :integer
    change_column :reports, :account_id, :integer
    change_column :reports, :action_taken_by_account_id, :integer
    change_column :reports, :id, :integer
    change_column :reports, :target_account_id, :integer
    change_column :session_activations, :access_token_id, :integer
    change_column :session_activations, :user_id, :integer
    change_column :session_activations, :web_push_subscription_id, :integer
    change_column :settings, :id, :integer
    change_column :settings, :thing_id, :integer
    change_column :statuses, :account_id, :integer
    change_column :statuses, :application_id, :integer
    change_column :statuses, :in_reply_to_account_id, :integer
    change_column :stream_entries, :account_id, :integer
    change_column :stream_entries, :id, :integer
    change_column :subscriptions, :account_id, :integer
    change_column :subscriptions, :id, :integer
    change_column :tags, :id, :integer
    change_column :users, :account_id, :integer
    change_column :users, :id, :integer
    change_column :web_settings, :id, :integer
    change_column :web_settings, :user_id, :integer
  end
end