diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170209184350_add_reply_to_statuses.rb | 10 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/db/migrate/20170209184350_add_reply_to_statuses.rb b/db/migrate/20170209184350_add_reply_to_statuses.rb new file mode 100644 index 000000000..c5074728b --- /dev/null +++ b/db/migrate/20170209184350_add_reply_to_statuses.rb @@ -0,0 +1,10 @@ +class AddReplyToStatuses < ActiveRecord::Migration[5.0] + def up + add_column :statuses, :reply, :boolean, nil: false, default: false + Status.update_all('reply = (in_reply_to_id IS NOT NULL)') + end + + def down + remove_column :statuses, :reply + end +end diff --git a/db/schema.rb b/db/schema.rb index 28a578aa2..86a05ebe6 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: 20170205175257) do +ActiveRecord::Schema.define(version: 20170209184350) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -197,6 +197,7 @@ ActiveRecord::Schema.define(version: 20170205175257) do t.integer "in_reply_to_account_id" t.integer "application_id" t.text "spoiler_text", default: "", null: false + t.boolean "reply", default: false t.index ["account_id"], name: "index_statuses_on_account_id", using: :btree t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id", using: :btree t.index ["reblog_of_id"], name: "index_statuses_on_reblog_of_id", using: :btree |