db migrate enums

This commit is contained in:
Matt Jankowski 2024-11-15 20:21:42 -05:00
parent a3f7812cf9
commit a20240c27b
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@ class RemoveSuspendedSilencedAccountFields < ActiveRecord::Migration[5.2]
class DomainBlock < ApplicationRecord
# Dummy class, to make migration possible across version changes
enum severity: [:silence, :suspend, :noop]
enum :severity, [:silence, :suspend, :noop]
has_many :accounts, foreign_key: :domain, primary_key: :domain
end

View file

@ -6,7 +6,7 @@ class FillAccountSuspensionOrigin < ActiveRecord::Migration[5.2]
class MigrationAccount < ApplicationRecord
self.table_name = :accounts
scope :suspended, -> { where.not(suspended_at: nil) }
enum suspension_origin: { local: 0, remote: 1 }, _prefix: true
enum :suspension_origin, { local: 0, remote: 1 }, prefix: true
end
def up