new revision migrations

This commit is contained in:
2458773093 2019-09-11 17:21:45 +03:00
parent d1f7d17ef5
commit cdc0b8dd2f
3 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
class AddRevisedAtToStatuses < ActiveRecord::Migration[5.2]
def change
add_column :statuses, :revised_at, :datetime
end
end

View File

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" 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 t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true
end 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| create_table "status_stats", force: :cascade do |t|
t.bigint "status_id", null: false t.bigint "status_id", null: false
t.bigint "replies_count", default: 0, 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.bigint "poll_id"
t.integer "group_id" t.integer "group_id"
t.bigint "quote_of_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 ["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 ["group_id"], name: "index_statuses_on_group_id"
t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id" t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"