diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-21 01:44:16 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:44:01 -0500 |
commit | 263ead73616dba43a0337c2a3edaf96a6382d533 (patch) | |
tree | ca47a9366dbbdf95018c55bde32b59d6b05c8299 /db | |
parent | 21de9efc2d89ce8dbb9edb997f8a3b99f831d05a (diff) |
[Feature] Add post and thread (un)hiding to backend
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200720211530_add_hidden_to_conversation_mute.rb | 7 | ||||
-rw-r--r-- | db/migrate/20200720212317_create_status_mutes.rb | 10 | ||||
-rw-r--r-- | db/schema.rb | 11 |
3 files changed, 27 insertions, 1 deletions
diff --git a/db/migrate/20200720211530_add_hidden_to_conversation_mute.rb b/db/migrate/20200720211530_add_hidden_to_conversation_mute.rb new file mode 100644 index 000000000..aa7b31d8b --- /dev/null +++ b/db/migrate/20200720211530_add_hidden_to_conversation_mute.rb @@ -0,0 +1,7 @@ +class AddHiddenToConversationMute < ActiveRecord::Migration[5.2] + def change + safety_assured do + add_column :conversation_mutes, :hidden, :boolean, default: false, null: false + end + end +end diff --git a/db/migrate/20200720212317_create_status_mutes.rb b/db/migrate/20200720212317_create_status_mutes.rb new file mode 100644 index 000000000..efd8f15c8 --- /dev/null +++ b/db/migrate/20200720212317_create_status_mutes.rb @@ -0,0 +1,10 @@ +class CreateStatusMutes < ActiveRecord::Migration[5.2] + def change + create_table :status_mutes do |t| + t.integer :account_id, null: false, index: true + t.bigint :status_id, null: false, index: true + end + + add_index :status_mutes, [:account_id, :status_id], unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 57783dc3a..b1fcad7db 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_07_19_184152) do +ActiveRecord::Schema.define(version: 2020_07_20_212317) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -278,6 +278,7 @@ ActiveRecord::Schema.define(version: 2020_07_19_184152) do create_table "conversation_mutes", force: :cascade do |t| t.bigint "conversation_id", null: false t.bigint "account_id", null: false + t.boolean "hidden", default: false, null: false t.index ["account_id", "conversation_id"], name: "index_conversation_mutes_on_account_id_and_conversation_id", unique: true end @@ -749,6 +750,14 @@ ActiveRecord::Schema.define(version: 2020_07_19_184152) do t.index ["var"], name: "index_site_uploads_on_var", unique: true end + create_table "status_mutes", force: :cascade do |t| + t.integer "account_id", null: false + t.bigint "status_id", null: false + t.index ["account_id", "status_id"], name: "index_status_mutes_on_account_id_and_status_id", unique: true + t.index ["account_id"], name: "index_status_mutes_on_account_id" + t.index ["status_id"], name: "index_status_mutes_on_status_id" + end + create_table "status_pins", force: :cascade do |t| t.bigint "account_id", null: false t.bigint "status_id", null: false |