about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-11-10 08:50:11 -0600
committerStarfall <us@starfall.systems>2022-11-10 08:50:11 -0600
commit67d1a0476d77e2ed0ca15dd2981c54c2b90b0742 (patch)
tree152f8c13a341d76738e8e2c09b24711936e6af68 /db/migrate
parentb581e6b6d4a5ba9ed4ae17427b7f2d5d158be4e5 (diff)
parentee7e49d1b1323618e16026bc8db8ab7f9459cc2d (diff)
Merge remote-tracking branch 'glitch/main'
- Remove Helm charts
- Lots of conflicts with our removal of recommended settings and custom
  icons
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170918125918_ids_to_bigints.rb2
-rw-r--r--db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb7
-rw-r--r--db/migrate/20220824233535_create_status_trends.rb12
-rw-r--r--db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb5
-rw-r--r--db/migrate/20220829192633_add_languages_to_follows.rb5
-rw-r--r--db/migrate/20220829192658_add_languages_to_follow_requests.rb5
-rw-r--r--db/migrate/20221006061337_create_preview_card_trends.rb11
-rw-r--r--db/migrate/20221012181003_add_blurhash_to_site_uploads.rb5
-rw-r--r--db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb19
-rw-r--r--db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb17
-rw-r--r--db/migrate/20221104133904_add_name_to_featured_tags.rb5
11 files changed, 92 insertions, 1 deletions
diff --git a/db/migrate/20170918125918_ids_to_bigints.rb b/db/migrate/20170918125918_ids_to_bigints.rb
index bcb2e9eca..bf875e4e5 100644
--- a/db/migrate/20170918125918_ids_to_bigints.rb
+++ b/db/migrate/20170918125918_ids_to_bigints.rb
@@ -80,7 +80,7 @@ class IdsToBigints < ActiveRecord::Migration[5.1]
       say 'This migration has some sections that can be safely interrupted'
       say 'and restarted later, and will tell you when those are occurring.'
       say ''
-      say 'For more information, see https://github.com/tootsuite/mastodon/pull/5088'
+      say 'For more information, see https://github.com/mastodon/mastodon/pull/5088'
 
       10.downto(1) do |i|
         say "Continuing in #{i} second#{i == 1 ? '' : 's'}...", true
diff --git a/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb b/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb
new file mode 100644
index 000000000..2cb8cddf1
--- /dev/null
+++ b/db/migrate/20220824164433_add_human_identifier_to_admin_action_logs.rb
@@ -0,0 +1,7 @@
+class AddHumanIdentifierToAdminActionLogs < ActiveRecord::Migration[6.1]
+  def change
+    add_column :admin_action_logs, :human_identifier, :string
+    add_column :admin_action_logs, :route_param, :string
+    add_column :admin_action_logs, :permalink, :string
+  end
+end
diff --git a/db/migrate/20220824233535_create_status_trends.rb b/db/migrate/20220824233535_create_status_trends.rb
new file mode 100644
index 000000000..cea0abf35
--- /dev/null
+++ b/db/migrate/20220824233535_create_status_trends.rb
@@ -0,0 +1,12 @@
+class CreateStatusTrends < ActiveRecord::Migration[6.1]
+  def change
+    create_table :status_trends do |t|
+      t.references :status, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
+      t.references :account, null: false, foreign_key: { on_delete: :cascade }
+      t.float :score, null: false, default: 0
+      t.integer :rank, null: false, default: 0
+      t.boolean :allowed, null: false, default: false
+      t.string :language
+    end
+  end
+end
diff --git a/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb b/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb
new file mode 100644
index 000000000..5b3ec4727
--- /dev/null
+++ b/db/migrate/20220827195229_change_canonical_email_blocks_nullable.rb
@@ -0,0 +1,5 @@
+class ChangeCanonicalEmailBlocksNullable < ActiveRecord::Migration[6.1]
+  def change
+    safety_assured { change_column :canonical_email_blocks, :reference_account_id, :bigint, null: true, default: nil }
+  end
+end
diff --git a/db/migrate/20220829192633_add_languages_to_follows.rb b/db/migrate/20220829192633_add_languages_to_follows.rb
new file mode 100644
index 000000000..f6cf48880
--- /dev/null
+++ b/db/migrate/20220829192633_add_languages_to_follows.rb
@@ -0,0 +1,5 @@
+class AddLanguagesToFollows < ActiveRecord::Migration[6.1]
+  def change
+    add_column :follows, :languages, :string, array: true
+  end
+end
diff --git a/db/migrate/20220829192658_add_languages_to_follow_requests.rb b/db/migrate/20220829192658_add_languages_to_follow_requests.rb
new file mode 100644
index 000000000..f98fabb22
--- /dev/null
+++ b/db/migrate/20220829192658_add_languages_to_follow_requests.rb
@@ -0,0 +1,5 @@
+class AddLanguagesToFollowRequests < ActiveRecord::Migration[6.1]
+  def change
+    add_column :follow_requests, :languages, :string, array: true
+  end
+end
diff --git a/db/migrate/20221006061337_create_preview_card_trends.rb b/db/migrate/20221006061337_create_preview_card_trends.rb
new file mode 100644
index 000000000..baad9c31c
--- /dev/null
+++ b/db/migrate/20221006061337_create_preview_card_trends.rb
@@ -0,0 +1,11 @@
+class CreatePreviewCardTrends < ActiveRecord::Migration[6.1]
+  def change
+    create_table :preview_card_trends do |t|
+      t.references :preview_card, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
+      t.float :score, null: false, default: 0
+      t.integer :rank, null: false, default: 0
+      t.boolean :allowed, null: false, default: false
+      t.string :language
+    end
+  end
+end
diff --git a/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb b/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb
new file mode 100644
index 000000000..e1c87712b
--- /dev/null
+++ b/db/migrate/20221012181003_add_blurhash_to_site_uploads.rb
@@ -0,0 +1,5 @@
+class AddBlurhashToSiteUploads < ActiveRecord::Migration[6.1]
+  def change
+    add_column :site_uploads, :blurhash, :string
+  end
+end
diff --git a/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb b/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb
new file mode 100644
index 000000000..74d7673f7
--- /dev/null
+++ b/db/migrate/20221021055441_add_index_featured_tags_on_account_id_and_tag_id.rb
@@ -0,0 +1,19 @@
+class AddIndexFeaturedTagsOnAccountIdAndTagId < ActiveRecord::Migration[6.1]
+  disable_ddl_transaction!
+
+  def up
+    duplicates = FeaturedTag.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM featured_tags GROUP BY account_id, tag_id HAVING count(*) > 1').to_ary
+
+    duplicates.each do |row|
+      FeaturedTag.where(id: row['ids'].split(',')[0...-1]).destroy_all
+    end
+
+    add_index :featured_tags, [:account_id, :tag_id], unique: true, algorithm: :concurrently
+    remove_index :featured_tags, [:account_id], algorithm: :concurrently
+  end
+
+  def down
+    add_index :featured_tags, [:account_id], algorithm: :concurrently
+    remove_index :featured_tags, [:account_id, :tag_id], unique: true, algorithm: :concurrently
+  end
+end
diff --git a/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb b/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb
new file mode 100644
index 000000000..0221369b7
--- /dev/null
+++ b/db/migrate/20221025171544_add_index_ip_blocks_on_ip.rb
@@ -0,0 +1,17 @@
+class AddIndexIpBlocksOnIp < ActiveRecord::Migration[6.1]
+  disable_ddl_transaction!
+
+  def up
+    duplicates = IpBlock.connection.select_all('SELECT string_agg(id::text, \',\') AS ids FROM ip_blocks GROUP BY ip HAVING count(*) > 1').to_ary
+
+    duplicates.each do |row|
+      IpBlock.where(id: row['ids'].split(',')[0...-1]).destroy_all
+    end
+
+    add_index :ip_blocks, :ip, unique: true, algorithm: :concurrently
+  end
+
+  def down
+    remove_index :ip_blocks, :ip, unique: true
+  end
+end
diff --git a/db/migrate/20221104133904_add_name_to_featured_tags.rb b/db/migrate/20221104133904_add_name_to_featured_tags.rb
new file mode 100644
index 000000000..7c8c8ebfb
--- /dev/null
+++ b/db/migrate/20221104133904_add_name_to_featured_tags.rb
@@ -0,0 +1,5 @@
+class AddNameToFeaturedTags < ActiveRecord::Migration[6.1]
+  def change
+    add_column :featured_tags, :name, :string
+  end
+end