about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-28 17:30:12 +0200
committerGitHub <noreply@github.com>2019-07-28 17:30:12 +0200
commit75f7f9930eb2a6f5c4041ec44fe0aa795c9ec449 (patch)
tree446b7fa050fa9e4c624a46eef874c5bd4441137e /db
parentcfb2ed78231758a79af038a964ab7f7b7b35274e (diff)
Remove conversation URI (#11423)
It is not part of ActivityPub and will free up a lot of space
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20190519130537_remove_boosts_widening_audience.rb2
-rw-r--r--db/post_migrate/20190728084117_remove_uri_from_conversations.rb12
-rw-r--r--db/schema.rb4
3 files changed, 15 insertions, 3 deletions
diff --git a/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb b/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
index d2d924239..b89efd989 100644
--- a/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
+++ b/db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 class RemoveBoostsWideningAudience < ActiveRecord::Migration[5.2]
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20190728084117_remove_uri_from_conversations.rb b/db/post_migrate/20190728084117_remove_uri_from_conversations.rb
new file mode 100644
index 000000000..b2b157ef7
--- /dev/null
+++ b/db/post_migrate/20190728084117_remove_uri_from_conversations.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class RemoveUriFromConversations < ActiveRecord::Migration[5.2]
+  def up
+    safety_assured { remove_column :conversations, :uri, :string }
+  end
+
+  def down
+    add_column :conversations, :uri, :string
+    add_index :conversations, :uri, unique: true
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1847305c7..a722bad36 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_07_26_175042) do
+ActiveRecord::Schema.define(version: 2019_07_28_084117) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -203,10 +203,8 @@ ActiveRecord::Schema.define(version: 2019_07_26_175042) do
   end
 
   create_table "conversations", force: :cascade do |t|
-    t.string "uri"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.index ["uri"], name: "index_conversations_on_uri", unique: true
   end
 
   create_table "custom_emoji_categories", force: :cascade do |t|