From 86c1b3c75d0898f7c0eff8a723bbeec71d1f54b4 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Fri, 24 Jul 2020 18:49:00 -0500 Subject: [PATCH] Added expires_at to Status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - expires_at key to Status --- .../20200722190844_add_expires_at_to_status.rb | 6 ++++++ db/schema.rb | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200722190844_add_expires_at_to_status.rb diff --git a/db/migrate/20200722190844_add_expires_at_to_status.rb b/db/migrate/20200722190844_add_expires_at_to_status.rb new file mode 100644 index 00000000..f50cca5f --- /dev/null +++ b/db/migrate/20200722190844_add_expires_at_to_status.rb @@ -0,0 +1,6 @@ +class AddExpiresAtToStatus < ActiveRecord::Migration[5.2] + def change + add_column :statuses, :expires_at, :datetime + add_index :statuses, :expires_at + end +end diff --git a/db/schema.rb b/db/schema.rb index f850f0f9..716db241 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_21_215336) do +ActiveRecord::Schema.define(version: 2020_07_22_190844) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" @@ -679,6 +679,16 @@ ActiveRecord::Schema.define(version: 2020_07_21_215336) do t.index ["var"], name: "index_site_uploads_on_var", unique: true end + create_table "status_bookmarks", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "account_id", null: false + t.bigint "status_id", null: false + t.index ["account_id", "status_id"], name: "index_status_bookmarks_on_account_id_and_status_id", unique: true + t.index ["account_id"], name: "index_status_bookmarks_on_account_id" + t.index ["status_id"], name: "index_status_bookmarks_on_status_id" + end + create_table "status_pins", force: :cascade do |t| t.bigint "account_id", null: false t.bigint "status_id", null: false @@ -727,6 +737,7 @@ ActiveRecord::Schema.define(version: 2020_07_21_215336) do t.bigint "quote_of_id" t.datetime "revised_at" t.text "markdown" + t.datetime "expires_at" t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc } t.index ["group_id"], name: "index_statuses_on_group_id" t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id" @@ -938,6 +949,8 @@ ActiveRecord::Schema.define(version: 2020_07_21_215336) do add_foreign_key "session_activations", "oauth_access_tokens", column: "access_token_id", name: "fk_957e5bda89", on_delete: :cascade add_foreign_key "session_activations", "users", name: "fk_e5fda67334", on_delete: :cascade add_foreign_key "shortcuts", "accounts", on_delete: :cascade + add_foreign_key "status_bookmarks", "accounts", on_delete: :cascade + add_foreign_key "status_bookmarks", "statuses", on_delete: :cascade add_foreign_key "status_pins", "accounts", name: "fk_d4cb435b62", on_delete: :cascade add_foreign_key "status_pins", "statuses", on_delete: :cascade add_foreign_key "status_stats", "statuses", on_delete: :cascade