Added new migrations
• Added: - new migrations
This commit is contained in:
7
db/migrate/20200806162649_add_index_to_statuses_reply.rb
Normal file
7
db/migrate/20200806162649_add_index_to_statuses_reply.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class AddIndexToStatusesReply < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :statuses, :reply, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
14
db/migrate/20200806174026_create_group_join_requests.rb
Normal file
14
db/migrate/20200806174026_create_group_join_requests.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateGroupJoinRequests < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
create_table :group_join_requests do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
|
||||
t.belongs_to :group, foreign_key: { on_delete: :cascade }, null: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :group_join_requests, [:account_id, :group_id], unique: true, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
10
db/migrate/20200806231714_add_indexes_to_status_stats.rb
Normal file
10
db/migrate/20200806231714_add_indexes_to_status_stats.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class AddIndexesToStatusStats < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :status_stats, :updated_at, algorithm: :concurrently
|
||||
add_index :status_stats, :replies_count, algorithm: :concurrently
|
||||
add_index :status_stats, :reblogs_count, algorithm: :concurrently
|
||||
add_index :status_stats, :favourites_count, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user