Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `app/controllers/statuses_controller.rb`: Minor conflict due to theming system
This commit is contained in:
16
db/migrate/20191218153258_create_announcements.rb
Normal file
16
db/migrate/20191218153258_create_announcements.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateAnnouncements < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :announcements do |t|
|
||||
t.text :text, null: false, default: ''
|
||||
|
||||
t.boolean :published, null: false, default: false
|
||||
t.boolean :all_day, null: false, default: false
|
||||
|
||||
t.datetime :scheduled_at
|
||||
t.datetime :starts_at
|
||||
t.datetime :ends_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
12
db/migrate/20200113125135_create_announcement_mutes.rb
Normal file
12
db/migrate/20200113125135_create_announcement_mutes.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateAnnouncementMutes < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :announcement_mutes do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade, index: false }
|
||||
t.belongs_to :announcement, foreign_key: { on_delete: :cascade }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :announcement_mutes, [:account_id, :announcement_id], unique: true
|
||||
end
|
||||
end
|
||||
15
db/migrate/20200114113335_create_announcement_reactions.rb
Normal file
15
db/migrate/20200114113335_create_announcement_reactions.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class CreateAnnouncementReactions < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :announcement_reactions do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade, index: false }
|
||||
t.belongs_to :announcement, foreign_key: { on_delete: :cascade }
|
||||
|
||||
t.string :name, null: false, default: ''
|
||||
t.belongs_to :custom_emoji, foreign_key: { on_delete: :cascade }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :announcement_reactions, [:account_id, :announcement_id, :name], unique: true, name: :index_announcement_reactions_on_account_id_and_announcement_id
|
||||
end
|
||||
end
|
||||
11
db/migrate/20200119112504_add_public_index_to_statuses.rb
Normal file
11
db/migrate/20200119112504_add_public_index_to_statuses.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddPublicIndexToStatuses < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_index :statuses, [:id, :account_id], name: :index_statuses_public_20200119, algorithm: :concurrently, order: { id: :desc }, where: 'deleted_at IS NULL AND visibility = 0 AND reblog_of_id IS NULL AND ((NOT reply) OR (in_reply_to_account_id = account_id))'
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :statuses, name: :index_statuses_public_20200119
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user