diff --git a/db/migrate/20190917135359_create_status_revisions.rb b/db/migrate/20190917135359_create_status_revisions.rb new file mode 100644 index 00000000..d3ca5bd5 --- /dev/null +++ b/db/migrate/20190917135359_create_status_revisions.rb @@ -0,0 +1,9 @@ +class CreateStatusRevisions < ActiveRecord::Migration[5.2] + def change + create_table :status_revisions do |t| + t.bigint :status_id + t.string :text + t.timestamps + end + end +end diff --git a/db/migrate/20190917141707_add_revised_at_to_statuses.rb b/db/migrate/20190917141707_add_revised_at_to_statuses.rb new file mode 100644 index 00000000..a9e88d78 --- /dev/null +++ b/db/migrate/20190917141707_add_revised_at_to_statuses.rb @@ -0,0 +1,5 @@ +class AddRevisedAtToStatuses < ActiveRecord::Migration[5.2] + def change + add_column :statuses, :revised_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index ac9420ea..a81bcc54 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: 2019_09_03_162122) do +ActiveRecord::Schema.define(version: 2019_09_17_141707) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -672,6 +672,13 @@ ActiveRecord::Schema.define(version: 2019_09_03_162122) do t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true end + create_table "status_revisions", force: :cascade do |t| + t.bigint "status_id" + t.string "text" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "status_stats", force: :cascade do |t| t.bigint "status_id", null: false t.bigint "replies_count", default: 0, null: false @@ -703,6 +710,7 @@ ActiveRecord::Schema.define(version: 2019_09_03_162122) do t.bigint "poll_id" t.integer "group_id" t.bigint "quote_of_id" + t.datetime "revised_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"