0
0
Fork 0

Revert "Use PostgreSQL inheritance for blocks and mutes (#2520)" (#2634)

This reverts commit 5135d609b7.
This commit is contained in:
Akihiko Odaki 2017-04-30 21:49:24 +09:00 committed by Matt Jankowski
parent 4a5f73c8ae
commit a6788662b0
7 changed files with 12 additions and 43 deletions

View file

@ -1,19 +0,0 @@
class CreateBlockMutes < ActiveRecord::Migration[5.0]
def change
create_table "block_mutes", force: :casecade do |t|
t.integer "account_id", null: false
t.integer "target_account_id", null: false
t.boolean "block", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_column :blocks, :block, :boolean, null: false
execute "ALTER TABLE blocks ADD CONSTRAINT check_mutes_on_block CHECK(block = TRUE), INHERIT block_mutes"
Block.update_all block: true
add_column :mutes, :block, :boolean, null: false
execute "ALTER TABLE mutes ADD CONSTRAINT check_mutes_on_block CHECK(block = FALSE), INHERIT block_mutes"
Mute.update_all block: false
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180428000000) do
ActiveRecord::Schema.define(version: 20170425202925) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -54,23 +54,13 @@ ActiveRecord::Schema.define(version: 20180428000000) do
t.index ["username", "domain"], name: "index_accounts_on_username_and_domain", unique: true, using: :btree
end
create_table "block_mutes", force: :cascade, id: false do |t|
t.integer "account_id", null: false
t.integer "target_account_id", null: false
t.boolean "block", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "blocks", force: :cascade do |t|
t.integer "account_id", null: false
t.integer "target_account_id", null: false
t.boolean "block", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "target_account_id"], name: "index_blocks_on_account_id_and_target_account_id", unique: true, using: :btree
end
execute "ALTER TABLE blocks ADD CONSTRAINT check_blocks_on_block CHECK(block = TRUE), INHERIT block_mutes"
create_table "domain_blocks", force: :cascade do |t|
t.string "domain", default: "", null: false
@ -147,12 +137,10 @@ ActiveRecord::Schema.define(version: 20180428000000) do
create_table "mutes", force: :cascade do |t|
t.integer "account_id", null: false
t.integer "target_account_id", null: false
t.boolean "block", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "target_account_id"], name: "index_mutes_on_account_id_and_target_account_id", unique: true, using: :btree
end
execute "ALTER TABLE mutes ADD CONSTRAINT check_mutes_on_block CHECK(block = FALSE), INHERIT block_mutes"
create_table "notifications", force: :cascade do |t|
t.integer "account_id"