Merge tag 'v2.8.0' into instance_only_statuses
This commit is contained in:
@ -7,6 +7,7 @@ class CreateAccountModerationNotes < ActiveRecord::Migration[5.1]
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_foreign_key :account_moderation_notes, :accounts, column: :target_account_id
|
||||
end
|
||||
end
|
||||
|
17
db/migrate/20190201012802_add_overwrite_to_imports.rb
Normal file
17
db/migrate/20190201012802_add_overwrite_to_imports.rb
Normal file
@ -0,0 +1,17 @@
|
||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
||||
|
||||
class AddOverwriteToImports < ActiveRecord::Migration[5.2]
|
||||
include Mastodon::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured do
|
||||
add_column_with_default :imports, :overwrite, :boolean, default: false, allow_null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :imports, :overwrite, :boolean
|
||||
end
|
||||
end
|
12
db/migrate/20190203180359_create_featured_tags.rb
Normal file
12
db/migrate/20190203180359_create_featured_tags.rb
Normal file
@ -0,0 +1,12 @@
|
||||
class CreateFeaturedTags < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :featured_tags do |t|
|
||||
t.references :account, foreign_key: { on_delete: :cascade }
|
||||
t.references :tag, foreign_key: { on_delete: :cascade }
|
||||
t.bigint :statuses_count, default: 0, null: false
|
||||
t.datetime :last_status_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
17
db/migrate/20190225031541_create_polls.rb
Normal file
17
db/migrate/20190225031541_create_polls.rb
Normal file
@ -0,0 +1,17 @@
|
||||
class CreatePolls < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :polls do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :status, foreign_key: { on_delete: :cascade }
|
||||
t.datetime :expires_at
|
||||
t.string :options, null: false, array: true, default: []
|
||||
t.bigint :cached_tallies, null: false, array: true, default: []
|
||||
t.boolean :multiple, null: false, default: false
|
||||
t.boolean :hide_totals, null: false, default: false
|
||||
t.bigint :votes_count, null: false, default: 0
|
||||
t.datetime :last_fetched_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20190225031625_create_poll_votes.rb
Normal file
11
db/migrate/20190225031625_create_poll_votes.rb
Normal file
@ -0,0 +1,11 @@
|
||||
class CreatePollVotes < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :poll_votes do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :poll, foreign_key: { on_delete: :cascade }
|
||||
t.integer :choice, null: false, default: 0
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20190226003449_add_poll_id_to_statuses.rb
Normal file
5
db/migrate/20190226003449_add_poll_id_to_statuses.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddPollIdToStatuses < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :statuses, :poll_id, :bigint
|
||||
end
|
||||
end
|
5
db/migrate/20190304152020_add_uri_to_poll_votes.rb
Normal file
5
db/migrate/20190304152020_add_uri_to_poll_votes.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddUriToPollVotes < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :poll_votes, :uri, :string
|
||||
end
|
||||
end
|
24
db/migrate/20190306145741_add_lock_version_to_polls.rb
Normal file
24
db/migrate/20190306145741_add_lock_version_to_polls.rb
Normal file
@ -0,0 +1,24 @@
|
||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
||||
|
||||
class AddLockVersionToPolls < ActiveRecord::Migration[5.2]
|
||||
include Mastodon::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured do
|
||||
add_column_with_default(
|
||||
:polls,
|
||||
:lock_version,
|
||||
:integer,
|
||||
allow_null: false,
|
||||
default: 0
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :polls, :lock_version
|
||||
end
|
||||
end
|
||||
|
23
db/migrate/20190307234537_add_approved_to_users.rb
Normal file
23
db/migrate/20190307234537_add_approved_to_users.rb
Normal file
@ -0,0 +1,23 @@
|
||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
||||
|
||||
class AddApprovedToUsers < ActiveRecord::Migration[5.2]
|
||||
include Mastodon::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured do
|
||||
add_column_with_default(
|
||||
:users,
|
||||
:approved,
|
||||
:bool,
|
||||
allow_null: false,
|
||||
default: true
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :users, :approved
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
class MigrateOpenRegistrationsSetting < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
open_registrations = Setting.find_by(var: 'open_registrations')
|
||||
return if open_registrations.nil? || open_registrations.value
|
||||
setting = Setting.where(var: 'registrations_mode').first_or_initialize(var: 'registrations_mode')
|
||||
setting.update(value: 'none')
|
||||
end
|
||||
|
||||
def down
|
||||
registrations_mode = Setting.find_by(var: 'registrations_mode')
|
||||
return if registrations_mode.nil?
|
||||
setting = Setting.where(var: 'open_registrations').first_or_initialize(var: 'open_registrations')
|
||||
setting.update(value: registrations_mode.value == 'open')
|
||||
end
|
||||
end
|
16
db/migrate/20190316190352_create_account_identity_proofs.rb
Normal file
16
db/migrate/20190316190352_create_account_identity_proofs.rb
Normal file
@ -0,0 +1,16 @@
|
||||
class CreateAccountIdentityProofs < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :account_identity_proofs do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.string :provider, null: false, default: ''
|
||||
t.string :provider_username, null: false, default: ''
|
||||
t.text :token, null: false, default: ''
|
||||
t.boolean :verified, null: false, default: false
|
||||
t.boolean :live, null: false, default: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :account_identity_proofs, [:account_id, :provider, :provider_username], unique: true, name: :index_account_proofs_on_account_and_provider_and_username
|
||||
end
|
||||
end
|
5
db/migrate/20190317135723_add_uri_to_reports.rb
Normal file
5
db/migrate/20190317135723_add_uri_to_reports.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class AddUriToReports < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :reports, :uri, :string
|
||||
end
|
||||
end
|
10
db/migrate/20190409054914_create_user_invite_requests.rb
Normal file
10
db/migrate/20190409054914_create_user_invite_requests.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class CreateUserInviteRequests < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :user_invite_requests do |t|
|
||||
t.belongs_to :user, foreign_key: { on_delete: :cascade }
|
||||
t.text :text
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user