Ir al contenido

Database

Esta página aún no está disponible en tu idioma.

Artist Alley keeps its persistent state in Postgres. app/schema.sql is a schema-only dump of a database built by running the migrations in app/internal/db/migrations/, and sqlc generates the Go query code against that checked-in file. The schema shows what is stored, not which features are finished: some tables back planned or partly built features, and a column existing doesn’t mean every rule it suggests is enforced. 94 tables, grouped below by what they’re for.

Each table is a node, and each line is a foreign key between two different tables. A table’s references to itself are left out, and relationships the database doesn’t enforce with a foreign key don’t appear. Open a table’s page, linked below, for its column-level detail.

erDiagram
  activities {
  }
  ai_provider_call {
  }
  api_tokens {
  }
  asset_alternates {
  }
  asset_companions {
  }
  asset_embedding_d768 {
  }
  asset_field_value {
  }
  asset_field_value_history {
  }
  asset_subtitle_tracks {
  }
  asset_tag {
  }
  asset_type_acls {
  }
  asset_types {
  }
  asset_visual_embedding {
  }
  assets {
  }
  audit_events {
  }
  audit_retention_policy {
  }
  brush_pack_stamps {
  }
  brush_packs {
  }
  capabilities {
  }
  collection_acls {
  }
  collection_field_value {
  }
  collection_field_value_history {
  }
  collection_posts {
  }
  collection_resources {
  }
  collections {
  }
  comments {
  }
  creative_lineage {
  }
  digest_queue {
  }
  direct_messages {
  }
  email_template {
  }
  email_verification_token {
  }
  extraction_failure {
  }
  featured_items {
  }
  federation_directories {
  }
  federation_directory_entries {
  }
  federation_dispatch_state {
  }
  federation_inbox {
  }
  federation_outbox {
  }
  federation_peer_suggestions {
  }
  federation_peers {
  }
  federation_remote_actors {
  }
  federation_shares {
  }
  federation_user_keys {
  }
  field_default_override {
  }
  field_definition {
  }
  goose_db_version {
  }
  jobs {
  }
  likes {
  }
  mcp_server_registration {
  }
  mcp_server_tool_grant {
  }
  metadata_backfill_run {
  }
  metadata_batch_preview {
  }
  notifications {
  }
  post_acls {
  }
  post_assets {
  }
  post_tags {
  }
  posts {
  }
  promo_bands {
  }
  resource_request {
  }
  role_capabilities {
  }
  roles {
  }
  saved_search {
  }
  scheduled_actions {
  }
  search_feedback {
  }
  search_reindex_run {
  }
  search_visual_backfill_run {
  }
  sessions {
  }
  site_text {
  }
  storage_objects {
  }
  storage_pins {
  }
  storage_sweep_findings {
  }
  storage_sweep_runs {
  }
  storage_variants {
  }
  system_config {
  }
  tag_follows {
  }
  team_closure {
  }
  team_follows {
  }
  team_memberships {
  }
  team_parents {
  }
  teams {
  }
  user {
  }
  user_blocks {
  }
  user_capability_grants {
  }
  user_capability_revokes {
  }
  user_follows {
  }
  user_password_history {
  }
  user_preferences {
  }
  user_profiles {
  }
  user_roles {
  }
  user_totp {
  }
  user_totp_recovery_code {
  }
  workflow_audit {
  }
  workflow_states {
  }
  workflow_transitions {
  }
  ai_provider_call }o--|| jobs : job_id
  asset_alternates }|--|| assets : asset_id
  asset_alternates }|--|| storage_objects : object_hash
  asset_companions }|--|| assets : asset_id
  asset_companions }|--|| storage_objects : object_hash
  asset_embedding_d768 }|--|| assets : asset_id
  asset_field_value }|--|| assets : asset_id
  asset_field_value }|--|| field_definition : field_id
  asset_field_value_history }|--|| assets : asset_id
  asset_field_value_history }|--|| field_definition : field_id
  asset_subtitle_tracks }|--|| assets : asset_id
  asset_tag }|--|| assets : asset_id
  asset_type_acls }|--|| asset_types : asset_type_ref
  asset_visual_embedding }|--|| assets : asset_id
  assets }|--|| asset_types : asset_type
  assets }o--|| storage_objects : file_hash
  assets }o--|| workflow_states : state_id
  assets }o--|| teams : team_id
  brush_pack_stamps }|--|| brush_packs : pack_id
  brush_packs }|--|| user : owner_user_ref
  collection_acls }|--|| collections : collection_id
  collection_field_value }|--|| collections : collection_id
  collection_field_value }|--|| field_definition : field_id
  collection_field_value_history }|--|| collections : collection_id
  collection_field_value_history }|--|| field_definition : field_id
  collection_posts }|--|| collections : collection_id
  collection_posts }|--|| posts : post_id
  collection_resources }|--|| collections : collection_id
  collection_resources }|--|| assets : asset_id
  collections }o--|| assets : cover_asset_id
  collections }o--|| assets : featured_cover_asset_id
  comments }o--|| federation_peers : peer_id
  creative_lineage }|--|| assets : derivative_asset_id
  creative_lineage }|--|| assets : source_asset_id
  digest_queue }|--|| user : user_ref
  digest_queue }|--|| notifications : notification_id
  email_template }o--|| user : updated_by_user_ref
  email_verification_token }|--|| user : user_ref
  extraction_failure }|--|| assets : asset_id
  featured_items }o--|| teams : team_id
  featured_items }o--|| promo_bands : band_id
  federation_directory_entries }|--|| federation_directories : directory_id
  federation_inbox }|--|| federation_peers : peer_id
  federation_inbox }o--|| activities : correlation_activity_id
  federation_outbox }|--|| activities : activity_id
  federation_outbox }|--|| federation_peers : peer_id
  federation_peer_suggestions }|--|| federation_peers : source_peer_id
  federation_remote_actors }|--|| federation_peers : peer_id
  federation_shares }|--|| federation_peers : peer_id
  federation_shares }|--|| activities : granted_activity_id
  federation_shares }o--|| activities : revoked_activity_id
  federation_user_keys }|--|| user : user_ref
  federation_user_keys }o--|| user : rotated_by_user_ref
  field_default_override }|--|| field_definition : field_id
  field_default_override }|--|| teams : team_id
  likes }o--|| federation_peers : peer_id
  mcp_server_tool_grant }|--|| mcp_server_registration : server_id
  metadata_backfill_run }o--|| user : started_by_user_ref
  metadata_batch_preview }|--|| field_definition : field_id
  post_acls }|--|| posts : post_id
  post_assets }|--|| posts : post_id
  post_assets }|--|| assets : asset_id
  post_tags }|--|| posts : post_id
  posts }o--|| assets : cover_asset_id
  posts }o--|| workflow_states : state_id
  posts }o--|| teams : team_id
  posts }o--|| assets : cover_thumbnail_asset_id
  resource_request }|--|| user : requester_user_ref
  resource_request }|--|| capabilities : requested_capability
  resource_request }o--|| user : decided_by_user_ref
  role_capabilities }|--|| roles : role_id
  role_capabilities }|--|| capabilities : capability_code
  saved_search }|--|| user : owner_user_ref
  search_feedback }|--|| assets : hit_asset_id
  search_feedback }|--|| user : user_ref
  search_reindex_run }o--|| user : started_by_user_ref
  search_visual_backfill_run }o--|| user : started_by_user_ref
  sessions }o--|| user : impersonated_by_user_ref
  site_text }o--|| user : updated_by_user_ref
  storage_pins }|--|| storage_objects : object_hash
  storage_sweep_findings }|--|| storage_sweep_runs : run_id
  storage_variants }|--|| storage_objects : object_hash
  tag_follows }|--|| user : user_ref
  team_closure }|--|| teams : ancestor_id
  team_closure }|--|| teams : descendant_id
  team_follows }|--|| user : user_ref
  team_follows }|--|| teams : team_id
  team_memberships }|--|| teams : team_id
  team_parents }|--|| teams : child_id
  team_parents }|--|| teams : parent_id
  teams }o--|| assets : hero_asset_id
  user_capability_grants }|--|| capabilities : capability_code
  user_capability_grants }o--|| teams : team_id
  user_capability_grants }o--|| resource_request : request_ref
  user_capability_revokes }|--|| capabilities : capability_code
  user_capability_revokes }o--|| teams : team_id
  user_roles }|--|| roles : role_id
  user_roles }o--|| teams : team_id
  user_totp }|--|| user : user_ref
  user_totp_recovery_code }|--|| user : user_ref
  workflow_audit }o--|| workflow_states : from_state_id
  workflow_audit }|--|| workflow_states : to_state_id
  workflow_transitions }o--|| workflow_states : from_state_id
  workflow_transitions }|--|| workflow_states : to_state_id
  workflow_transitions }o--|| capabilities : required_capability

Accounts, sessions, API tokens, the capability model (capabilities, roles and their assignments, plus per-user grants and revokes), and requests for access to restricted content.

Per-account settings and sign-in safeguards: preferences, password history, two-factor (TOTP) secrets and recovery codes, and email verification tokens.

Team hierarchy stored as both adjacency parents and a closure table for fast reachability queries.

The asset row and its type, per-asset-type access rules, tags, companion and alternate files, subtitle tracks, and lineage records linking a derived asset to its source.

Admin-defined fields and per-team default overrides, typed values and their history for assets and collections, plus bulk-edit previews, backfill runs and extraction failures.

Posts wrap one or many assets with shared metadata, tags, and per-post ACLs.

Collections group posts (collection_posts) and store their access grants (collection_acls). collection_resources holds the older asset-level memberships: collections no longer show or accept loose assets, but a few internal paths still read or write it.

Per-asset / per-post state machine: states, allowed transitions, and the audit trail of state changes.

Content-addressed storage objects, derived variants (thumbs / previews / waveforms), reference-count pins, and the runs and findings of storage integrity sweeps.

Comments and likes, follows of users, teams and tags, user blocks, and direct messages.

In-app notifications and the queue for digest emails.

Saved searches, feedback on search results, and the bookkeeping for search reindex and visual-embedding backfill runs.

Records of calls to AI providers, stored asset embeddings, and registered MCP servers with their tool grants. The tables exist on every install; whether they hold anything depends on which optional integrations an admin has set up.

The activities ledger, plus federation state: peers and peer suggestions, discovery directories and their entries, share grants, user keys, cached remote actors, and the inbox and outbox queues with the outbox dispatch cursor. What actually crosses between instances today is described on the ArchivePub page.

Curated placements for the featured rail, and operator promo bands shown in the feed.

The project-wide event ledger behind the audit log, and its per-category retention settings.

The async work queue, and actions scheduled to run at a later time.

Brush packs and stamp library powering the whiteboard / review annotation tools.

Server-wide configuration, operator overrides for interface wording, and transactional email templates.

Goose’s record of which migrations have been applied.

Each table page lists every column with its type, nullability and notes (including any foreign-key target and default value), and shows its CREATE TABLE statement under Full DDL. That block omits constraints added with separate ALTER TABLE statements and indexes defined elsewhere in the dump. Consult the complete app/schema.sql for those details. Where a table has foreign keys, a Connected to panel lists the tables it references and the tables that reference it. Most tables don’t have a written description yet.

Schema changes are made as goose migrations under app/internal/db/migrations/; app/schema.sql is then regenerated from the migrations, and the next site build picks up the change. A running install applies new migrations when it starts, so don’t alter its tables by hand.