mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 07:05:20 +00:00
db migrate enums
This commit is contained in:
parent
d96aacf0ef
commit
5142d85e4e
|
@ -7,7 +7,7 @@ class RemoveSuspendedSilencedAccountFields < ActiveRecord::Migration[5.2]
|
||||||
|
|
||||||
class DomainBlock < ApplicationRecord
|
class DomainBlock < ApplicationRecord
|
||||||
# Dummy class, to make migration possible across version changes
|
# 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
|
has_many :accounts, foreign_key: :domain, primary_key: :domain
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ class FillAccountSuspensionOrigin < ActiveRecord::Migration[5.2]
|
||||||
class MigrationAccount < ApplicationRecord
|
class MigrationAccount < ApplicationRecord
|
||||||
self.table_name = :accounts
|
self.table_name = :accounts
|
||||||
scope :suspended, -> { where.not(suspended_at: nil) }
|
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
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
Loading…
Reference in a new issue