Merge commit '715cbee93d419e26cf952bf7fc70f9c1cc217d8b' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2025-05-03 17:37:26 +02:00
198 changed files with 1539 additions and 1058 deletions

View File

@@ -0,0 +1,19 @@
# frozen_string_literal: true
class QuoteIdsToTimestampIds < ActiveRecord::Migration[8.0]
def up
# Set up the media_attachments.id column to use our timestamp-based IDs.
safety_assured do
execute("ALTER TABLE quotes ALTER COLUMN id SET DEFAULT timestamp_id('quotes')")
end
# Make sure we have a sequence to use.
Mastodon::Snowflake.ensure_id_sequences_exist
end
def down
execute('LOCK quotes')
execute("SELECT setval('quotes_id_seq', (SELECT MAX(id) FROM quotes))")
execute("ALTER TABLE quotes ALTER COLUMN id SET DEFAULT nextval('quotes_id_seq')")
end
end

View File

@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddQuoteApprovalPolicyToStatuses < ActiveRecord::Migration[8.0]
def change
add_column :statuses, :quote_approval_policy, :integer, null: false, default: 0
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_04_22_085303) do
ActiveRecord::Schema[8.0].define(version: 2025_04_28_095029) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
@@ -871,7 +871,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_04_22_085303) do
t.string "url"
end
create_table "quotes", force: :cascade do |t|
create_table "quotes", id: :bigint, default: -> { "timestamp_id('quotes'::text)" }, force: :cascade do |t|
t.bigint "account_id", null: false
t.bigint "status_id", null: false
t.bigint "quoted_status_id"
@@ -1089,6 +1089,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_04_22_085303) do
t.boolean "trendable"
t.bigint "ordered_media_attachment_ids", array: true
t.datetime "fetched_replies_at"
t.integer "quote_approval_policy", default: 0, null: false
t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)"
t.index ["account_id"], name: "index_statuses_on_account_id"
t.index ["deleted_at"], name: "index_statuses_on_deleted_at", where: "(deleted_at IS NOT NULL)"