Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - Gemfile - Gemfile.lock - app/controllers/about_controller.rb - app/controllers/auth/sessions_controller.rb
This commit is contained in:
@@ -3,7 +3,7 @@ class AddInReplyToAccountIdToStatuses < ActiveRecord::Migration[5.0]
|
||||
add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil
|
||||
|
||||
ActiveRecord::Base.transaction do
|
||||
Status.where.not(in_reply_to_id: nil).includes(:thread).find_each do |status|
|
||||
Status.unscoped.where.not(in_reply_to_id: nil).includes(:thread).find_each do |status|
|
||||
next if status.thread.nil?
|
||||
|
||||
status.in_reply_to_account_id = status.thread.account_id
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class AddReplyToStatuses < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
add_column :statuses, :reply, :boolean, nil: false, default: false
|
||||
Status.update_all('reply = (in_reply_to_id IS NOT NULL)')
|
||||
Status.unscoped.update_all('reply = (in_reply_to_id IS NOT NULL)')
|
||||
end
|
||||
|
||||
def down
|
||||
|
||||
12
db/migrate/20190914202517_create_account_migrations.rb
Normal file
12
db/migrate/20190914202517_create_account_migrations.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateAccountMigrations < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :account_migrations do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.string :acct, null: false, default: ''
|
||||
t.bigint :followers_count, null: false, default: 0
|
||||
t.belongs_to :target_account, foreign_key: { to_table: :accounts, on_delete: :nullify }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20190915194355_create_account_aliases.rb
Normal file
11
db/migrate/20190915194355_create_account_aliases.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateAccountAliases < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :account_aliases do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.string :acct, null: false, default: ''
|
||||
t.string :uri, null: false, default: ''
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20190927232842_add_voters_count_to_polls.rb
Normal file
5
db/migrate/20190927232842_add_voters_count_to_polls.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddVotersCountToPolls < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :polls, :voters_count, :bigint
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user