Merge commit 'f877aa9d70d0d600961989b8e97c0e0ce3ac1db6' into glitch-soc/merge-upstream
Conflicts: - `.github/dependabot.yml`: Upstream made changes, but we had removed it. Discarded upstream changes. - `.rubocop_todo.yml`: Upstream regenerated the file, we had some glitch-soc-specific ignores. - `app/models/account_statuses_filter.rb`: Minor upstream code style change where glitch-soc had slightly different code due to handling of local-only posts. Updated to match upstream's code style. - `app/models/status.rb`: Upstream moved ActiveRecord callback definitions, glitch-soc had an extra one. Moved the definitions as upstream did. - `app/services/backup_service.rb`: Upstream rewrote a lot of the backup service, glitch-soc had changes because of exporting local-only posts. Took upstream changes and added back code to deal with local-only posts. - `config/routes.rb`: Upstream split the file into different files, while glitch-soc had a few extra routes. Extra routes added to `config/routes/settings.rb`, `config/routes/api.rb` and `config/routes/admin.rb` - `db/schema.rb`: Upstream has new migrations, while glitch-soc had an extra migration. Updated the expected serial number to match upstream's. - `lib/mastodon/version.rb`: Upstream added support to set version tags from environment variables, while glitch-soc has an extra `+glitch` tag. Changed the code to support upstream's feature but prepending a `+glitch`. - `spec/lib/activitypub/activity/create_spec.rb`: Minor code style change upstream, while glitch-soc has extra tests due to `directMessage` handling. Applied upstream's changes while keeping glitch-soc's extra tests. - `spec/models/concerns/account_interactions_spec.rb`: Minor code style change upstream, while glitch-soc has extra tests. Applied upstream's changes while keeping glitch-soc's extra tests.
This commit is contained in:
22
db/migrate/20230330135507_create_bulk_imports.rb
Normal file
22
db/migrate/20230330135507_create_bulk_imports.rb
Normal file
@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateBulkImports < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :bulk_imports do |t|
|
||||
t.integer :type, null: false
|
||||
t.integer :state, null: false
|
||||
t.integer :total_items, null: false, default: 0
|
||||
t.integer :imported_items, null: false, default: 0
|
||||
t.integer :processed_items, null: false, default: 0
|
||||
t.datetime :finished_at
|
||||
t.boolean :overwrite, null: false, default: false
|
||||
t.boolean :likely_mismatched, null: false, default: false
|
||||
t.string :original_filename, null: false, default: ''
|
||||
t.references :account, null: false, foreign_key: { on_delete: :cascade }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :bulk_imports, [:id], name: :index_bulk_imports_unconfirmed, where: 'state = 0'
|
||||
end
|
||||
end
|
12
db/migrate/20230330140036_create_bulk_import_rows.rb
Normal file
12
db/migrate/20230330140036_create_bulk_import_rows.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateBulkImportRows < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :bulk_import_rows do |t|
|
||||
t.references :bulk_import, null: false, foreign_key: { on_delete: :cascade }
|
||||
t.jsonb :data
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFollowRequestIdToListAccounts < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
safety_assured { add_reference :list_accounts, :follow_request, foreign_key: { on_delete: :cascade }, index: false }
|
||||
add_index :list_accounts, :follow_request_id, algorithm: :concurrently, where: 'follow_request_id IS NOT NULL'
|
||||
end
|
||||
end
|
32
db/schema.rb
32
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: 2023_02_15_074424) do
|
||||
ActiveRecord::Schema.define(version: 2023_03_30_155710) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@ -294,6 +294,31 @@ ActiveRecord::Schema.define(version: 2023_02_15_074424) do
|
||||
t.index ["status_id"], name: "index_bookmarks_on_status_id"
|
||||
end
|
||||
|
||||
create_table "bulk_import_rows", force: :cascade do |t|
|
||||
t.bigint "bulk_import_id", null: false
|
||||
t.jsonb "data"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["bulk_import_id"], name: "index_bulk_import_rows_on_bulk_import_id"
|
||||
end
|
||||
|
||||
create_table "bulk_imports", force: :cascade do |t|
|
||||
t.integer "type", null: false
|
||||
t.integer "state", null: false
|
||||
t.integer "total_items", default: 0, null: false
|
||||
t.integer "imported_items", default: 0, null: false
|
||||
t.integer "processed_items", default: 0, null: false
|
||||
t.datetime "finished_at"
|
||||
t.boolean "overwrite", default: false, null: false
|
||||
t.boolean "likely_mismatched", default: false, null: false
|
||||
t.string "original_filename", default: "", null: false
|
||||
t.bigint "account_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["account_id"], name: "index_bulk_imports_on_account_id"
|
||||
t.index ["id"], name: "index_bulk_imports_unconfirmed", where: "(state = 0)"
|
||||
end
|
||||
|
||||
create_table "canonical_email_blocks", force: :cascade do |t|
|
||||
t.string "canonical_email_hash", default: "", null: false
|
||||
t.bigint "reference_account_id"
|
||||
@ -529,8 +554,10 @@ ActiveRecord::Schema.define(version: 2023_02_15_074424) do
|
||||
t.bigint "list_id", null: false
|
||||
t.bigint "account_id", null: false
|
||||
t.bigint "follow_id"
|
||||
t.bigint "follow_request_id"
|
||||
t.index ["account_id", "list_id"], name: "index_list_accounts_on_account_id_and_list_id", unique: true
|
||||
t.index ["follow_id"], name: "index_list_accounts_on_follow_id", where: "(follow_id IS NOT NULL)"
|
||||
t.index ["follow_request_id"], name: "index_list_accounts_on_follow_request_id", where: "(follow_request_id IS NOT NULL)"
|
||||
t.index ["list_id", "account_id"], name: "index_list_accounts_on_list_id_and_account_id"
|
||||
end
|
||||
|
||||
@ -1149,6 +1176,8 @@ ActiveRecord::Schema.define(version: 2023_02_15_074424) do
|
||||
add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
|
||||
add_foreign_key "bookmarks", "accounts", on_delete: :cascade
|
||||
add_foreign_key "bookmarks", "statuses", on_delete: :cascade
|
||||
add_foreign_key "bulk_import_rows", "bulk_imports", on_delete: :cascade
|
||||
add_foreign_key "bulk_imports", "accounts", on_delete: :cascade
|
||||
add_foreign_key "canonical_email_blocks", "accounts", column: "reference_account_id", on_delete: :cascade
|
||||
add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade
|
||||
add_foreign_key "conversation_mutes", "conversations", on_delete: :cascade
|
||||
@ -1174,6 +1203,7 @@ ActiveRecord::Schema.define(version: 2023_02_15_074424) do
|
||||
add_foreign_key "imports", "accounts", name: "fk_6db1b6e408", on_delete: :cascade
|
||||
add_foreign_key "invites", "users", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "accounts", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "follow_requests", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "follows", on_delete: :cascade
|
||||
add_foreign_key "list_accounts", "lists", on_delete: :cascade
|
||||
add_foreign_key "lists", "accounts", on_delete: :cascade
|
||||
|
Reference in New Issue
Block a user