about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-09 20:25:39 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-09 20:25:39 +0100
commit6331ed16e5953e3a006896c6df07b0f82cfd2350 (patch)
treeb1b03e90ccb2feddc65aaf689808658381118228 /db
parentc424df5192f346dba5332a4b3a2de43b2f028e0c (diff)
Fix #614 - extra reply-boolean on statuses to account for cases when replied-to
status is not in the system at time of distribution; fix #607 - reset privacy
settings to defaults when cancelling replies
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170209184350_add_reply_to_statuses.rb10
-rw-r--r--db/schema.rb3
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