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
|
74
db/schema.rb
74
db/schema.rb
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
ActiveRecord::Schema.define(version: 2019_04_09_054914) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@ -36,6 +36,19 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true
|
||||
end
|
||||
|
||||
create_table "account_identity_proofs", force: :cascade do |t|
|
||||
t.bigint "account_id"
|
||||
t.string "provider", default: "", null: false
|
||||
t.string "provider_username", default: "", null: false
|
||||
t.text "token", default: "", null: false
|
||||
t.boolean "verified", default: false, null: false
|
||||
t.boolean "live", default: false, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["account_id", "provider", "provider_username"], name: "index_account_proofs_on_account_and_provider_and_username", unique: true
|
||||
t.index ["account_id"], name: "index_account_identity_proofs_on_account_id"
|
||||
end
|
||||
|
||||
create_table "account_moderation_notes", force: :cascade do |t|
|
||||
t.text "content", null: false
|
||||
t.bigint "account_id", null: false
|
||||
@ -250,6 +263,17 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.index ["status_id"], name: "index_favourites_on_status_id"
|
||||
end
|
||||
|
||||
create_table "featured_tags", force: :cascade do |t|
|
||||
t.bigint "account_id"
|
||||
t.bigint "tag_id"
|
||||
t.bigint "statuses_count", default: 0, null: false
|
||||
t.datetime "last_status_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["account_id"], name: "index_featured_tags_on_account_id"
|
||||
t.index ["tag_id"], name: "index_featured_tags_on_tag_id"
|
||||
end
|
||||
|
||||
create_table "follow_requests", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
@ -290,6 +314,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.integer "data_file_size"
|
||||
t.datetime "data_updated_at"
|
||||
t.bigint "account_id", null: false
|
||||
t.boolean "overwrite", default: false, null: false
|
||||
end
|
||||
|
||||
create_table "invites", force: :cascade do |t|
|
||||
@ -429,6 +454,34 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.index ["database", "captured_at"], name: "index_pghero_space_stats_on_database_and_captured_at"
|
||||
end
|
||||
|
||||
create_table "poll_votes", force: :cascade do |t|
|
||||
t.bigint "account_id"
|
||||
t.bigint "poll_id"
|
||||
t.integer "choice", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "uri"
|
||||
t.index ["account_id"], name: "index_poll_votes_on_account_id"
|
||||
t.index ["poll_id"], name: "index_poll_votes_on_poll_id"
|
||||
end
|
||||
|
||||
create_table "polls", force: :cascade do |t|
|
||||
t.bigint "account_id"
|
||||
t.bigint "status_id"
|
||||
t.datetime "expires_at"
|
||||
t.string "options", default: [], null: false, array: true
|
||||
t.bigint "cached_tallies", default: [], null: false, array: true
|
||||
t.boolean "multiple", default: false, null: false
|
||||
t.boolean "hide_totals", default: false, null: false
|
||||
t.bigint "votes_count", default: 0, null: false
|
||||
t.datetime "last_fetched_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "lock_version", default: 0, null: false
|
||||
t.index ["account_id"], name: "index_polls_on_account_id"
|
||||
t.index ["status_id"], name: "index_polls_on_status_id"
|
||||
end
|
||||
|
||||
create_table "preview_cards", force: :cascade do |t|
|
||||
t.string "url", default: "", null: false
|
||||
t.string "title", default: "", null: false
|
||||
@ -485,6 +538,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.bigint "action_taken_by_account_id"
|
||||
t.bigint "target_account_id", null: false
|
||||
t.bigint "assigned_account_id"
|
||||
t.string "uri"
|
||||
t.index ["account_id"], name: "index_reports_on_account_id"
|
||||
t.index ["target_account_id"], name: "index_reports_on_target_account_id"
|
||||
end
|
||||
@ -569,6 +623,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.bigint "account_id", null: false
|
||||
t.bigint "application_id"
|
||||
t.bigint "in_reply_to_account_id"
|
||||
t.bigint "poll_id"
|
||||
t.boolean "local_only"
|
||||
t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc }
|
||||
t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"
|
||||
@ -625,6 +680,14 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.index ["uri"], name: "index_tombstones_on_uri"
|
||||
end
|
||||
|
||||
create_table "user_invite_requests", force: :cascade do |t|
|
||||
t.bigint "user_id"
|
||||
t.text "text"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["user_id"], name: "index_user_invite_requests_on_user_id"
|
||||
end
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "email", default: "", null: false
|
||||
t.datetime "created_at", null: false
|
||||
@ -659,6 +722,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
t.string "remember_token"
|
||||
t.string "chosen_languages", array: true
|
||||
t.bigint "created_by_application_id"
|
||||
t.boolean "approved", default: true, null: false
|
||||
t.index ["account_id"], name: "index_users_on_account_id"
|
||||
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
||||
t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id"
|
||||
@ -690,6 +754,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
add_foreign_key "account_conversations", "accounts", on_delete: :cascade
|
||||
add_foreign_key "account_conversations", "conversations", on_delete: :cascade
|
||||
add_foreign_key "account_domain_blocks", "accounts", name: "fk_206c6029bd", on_delete: :cascade
|
||||
add_foreign_key "account_identity_proofs", "accounts", on_delete: :cascade
|
||||
add_foreign_key "account_moderation_notes", "accounts"
|
||||
add_foreign_key "account_moderation_notes", "accounts", column: "target_account_id"
|
||||
add_foreign_key "account_pins", "accounts", column: "target_account_id", on_delete: :cascade
|
||||
@ -708,6 +773,8 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
add_foreign_key "custom_filters", "accounts", on_delete: :cascade
|
||||
add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade
|
||||
add_foreign_key "favourites", "statuses", name: "fk_b0e856845e", on_delete: :cascade
|
||||
add_foreign_key "featured_tags", "accounts", on_delete: :cascade
|
||||
add_foreign_key "featured_tags", "tags", on_delete: :cascade
|
||||
add_foreign_key "follow_requests", "accounts", column: "target_account_id", name: "fk_9291ec025d", on_delete: :cascade
|
||||
add_foreign_key "follow_requests", "accounts", name: "fk_76d644b0e7", on_delete: :cascade
|
||||
add_foreign_key "follows", "accounts", column: "target_account_id", name: "fk_745ca29eac", on_delete: :cascade
|
||||
@ -733,6 +800,10 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id", name: "fk_f5fc4c1ee3", on_delete: :cascade
|
||||
add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id", name: "fk_e84df68546", on_delete: :cascade
|
||||
add_foreign_key "oauth_applications", "users", column: "owner_id", name: "fk_b0988c7c0a", on_delete: :cascade
|
||||
add_foreign_key "poll_votes", "accounts", on_delete: :cascade
|
||||
add_foreign_key "poll_votes", "polls", on_delete: :cascade
|
||||
add_foreign_key "polls", "accounts", on_delete: :cascade
|
||||
add_foreign_key "polls", "statuses", on_delete: :cascade
|
||||
add_foreign_key "report_notes", "accounts", on_delete: :cascade
|
||||
add_foreign_key "report_notes", "reports", on_delete: :cascade
|
||||
add_foreign_key "reports", "accounts", column: "action_taken_by_account_id", name: "fk_bca45b75fd", on_delete: :nullify
|
||||
@ -754,6 +825,7 @@ ActiveRecord::Schema.define(version: 2019_01_17_114553) do
|
||||
add_foreign_key "stream_entries", "accounts", name: "fk_5659b17554", on_delete: :cascade
|
||||
add_foreign_key "subscriptions", "accounts", name: "fk_9847d1cbb5", on_delete: :cascade
|
||||
add_foreign_key "tombstones", "accounts", on_delete: :cascade
|
||||
add_foreign_key "user_invite_requests", "users", on_delete: :cascade
|
||||
add_foreign_key "users", "accounts", name: "fk_50500f500d", on_delete: :cascade
|
||||
add_foreign_key "users", "invites", on_delete: :nullify
|
||||
add_foreign_key "users", "oauth_applications", column: "created_by_application_id", on_delete: :nullify
|
||||
|
@ -4,5 +4,5 @@ if Rails.env.development?
|
||||
domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain
|
||||
admin = Account.where(username: 'admin').first_or_initialize(username: 'admin')
|
||||
admin.save(validate: false)
|
||||
User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true).save!
|
||||
User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true, approved: true).save!
|
||||
end
|
||||
|
Reference in New Issue
Block a user