Merge remote-tracking branch 'parent/main' into upstream-20241206
This commit is contained in:
commit
3c3ee557d0
187 changed files with 1105 additions and 537 deletions
|
@ -13,6 +13,13 @@ class MigrateHideNetworkPreference < ActiveRecord::Migration[6.1]
|
|||
belongs_to :account
|
||||
end
|
||||
|
||||
class Setting < ApplicationRecord
|
||||
# Mirror the behavior of the `Setting` model at this point in db history
|
||||
def value
|
||||
YAML.safe_load(self[:value], permitted_classes: [ActiveSupport::HashWithIndifferentAccess, Symbol]) if self[:value].present?
|
||||
end
|
||||
end
|
||||
|
||||
def up
|
||||
Account.reset_column_information
|
||||
|
||||
|
|
15
db/migrate/20241111141355_create_tag_trends.rb
Normal file
15
db/migrate/20241111141355_create_tag_trends.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateTagTrends < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :tag_trends do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
||||
t.references :tag, null: false, foreign_key: { on_delete: :cascade }, index: false
|
||||
t.float :score, null: false, default: 0
|
||||
t.integer :rank, null: false, default: 0
|
||||
t.boolean :allowed, null: false, default: false
|
||||
t.string :language, null: false, default: ''
|
||||
end
|
||||
|
||||
add_index :tag_trends, [:tag_id, :language], unique: true
|
||||
end
|
||||
end
|
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveLegacyUserSettingsData < ActiveRecord::Migration[7.2]
|
||||
def up
|
||||
connection.execute(<<~SQL.squish)
|
||||
DELETE FROM settings
|
||||
WHERE
|
||||
thing_type IS NOT NULL
|
||||
AND thing_id IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue