about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-07-17 21:54:12 +0200
committerGitHub <noreply@github.com>2018-07-17 21:54:12 +0200
commit012ca4c68d785dcf13e4cabd16b09a844e622f6b (patch)
tree106543bbde5ca7a43920ae13928d9ead0075e88b /db
parent8e8491e1dab5e2ed98770710e0a32484de8530b3 (diff)
parentbcf157a1a9597595c61b1cce84bd62f63fcaa90b (diff)
Merge pull request #578 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb2
-rw-r--r--db/migrate/20180711152640_create_relays.rb12
-rw-r--r--db/schema.rb11
3 files changed, 23 insertions, 2 deletions
diff --git a/db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb b/db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb
index 4a8761fec..ccd2ec7ea 100644
--- a/db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb
+++ b/db/migrate/20180514140000_revert_index_change_on_statuses_for_api_v1_accounts_account_id_statuses.rb
@@ -5,7 +5,7 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
 
   def change
     safety_assured do
-      add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_exists?(:statuses, name: "index_statuses_20180106")
+      add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, "index_statuses_20180106")
     end
 
     # These index may not exists (see migration 20180514130000)
diff --git a/db/migrate/20180711152640_create_relays.rb b/db/migrate/20180711152640_create_relays.rb
new file mode 100644
index 000000000..8762f473a
--- /dev/null
+++ b/db/migrate/20180711152640_create_relays.rb
@@ -0,0 +1,12 @@
+class CreateRelays < ActiveRecord::Migration[5.2]
+  def change
+    create_table :relays do |t|
+      t.string :inbox_url, default: '', null: false
+      t.boolean :enabled, default: false, null: false, index: true
+
+      t.string :follow_activity_id
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index cf42e80e9..3034b9bd6 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: 2018_07_07_193142) do
+ActiveRecord::Schema.define(version: 2018_07_11_152640) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -381,6 +381,15 @@ ActiveRecord::Schema.define(version: 2018_07_07_193142) do
     t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id"
   end
 
+  create_table "relays", force: :cascade do |t|
+    t.string "inbox_url", default: "", null: false
+    t.boolean "enabled", default: false, null: false
+    t.string "follow_activity_id"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["enabled"], name: "index_relays_on_enabled"
+  end
+
   create_table "report_notes", force: :cascade do |t|
     t.text "content", null: false
     t.bigint "report_id", null: false