Skip to content

Instantly share code, notes, and snippets.

@shugo
Created November 16, 2025 10:58
Show Gist options
  • Select an option

  • Save shugo/eb71108cae98798444e6311be4ef5976 to your computer and use it in GitHub Desktop.

Select an option

Save shugo/eb71108cae98798444e6311be4ef5976 to your computer and use it in GitHub Desktop.
media attachments statistics
mastodon@akagi:~/live$ psql -U mastodon -d mastodon_production -c "SELECT COUNT(*), COUNT(CASE WHEN file_storage_schema_version IS NULL OR file_storage_schema_version < 1 THEN 1 END) as old_schema, COUNT(CASE WHEN file_storage_schema_version >= 1 THEN 1 END) as new_schema, COUNT(CASE WHEN remote_url != '' THEN 1 END) as remote FROM media_attachments WHERE thumbnail_file_name IS NOT NULL;"
count | old_schema | new_schema | remote
-------+------------+------------+--------
13 | 0 | 13 | 13
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment