Skip to content

Marketplace data model: plugin_listings/versions/compat_matrix/ratings/install_events tables #249

Description

@tayebmokni

Summary

Define the plugin marketplace data model (schema only — the marketplace itself is out of scope for plugin runtime, deferred to P6). The platform must commit to the slug -> version -> bundle_hash triple as the immutable name of a plugin release. Filing this now so other subsystems dont paint themselves into a corner.

Design reference

  • docs/02-plugin-system.md §12

Acceptance criteria

  • Migration creates tables: plugin_listings, plugin_versions, plugin_compat_matrix, plugin_ratings, plugin_install_events matching the SQL in §12
  • plugin_versions(slug, version) is the PK; bundle_hash BYTEA UNIQUE (within slug)
  • Foreign keys: plugin_versions.slug -> plugin_listings.slug (on delete cascade), plugin_ratings.slug -> plugin_listings.slug
  • Indexes: plugin_listings.category GIN, plugin_versions.published_at DESC, plugin_install_events.ts
  • No marketplace REST endpoints in this issue — only schema. Marketplace itself is P6.
  • plugin_versions.yanked BOOLEAN allows publisher/operator to mark a release as withdrawn; install flow refuses yanked versions unless operator explicitly opts in
  • Audit triggers on plugin_listings.publisher_id changes (security-sensitive)
  • Tests: schema migrations up/down clean; PK/UNIQUE/FK constraints enforced

Dependencies

db migration infra

Complexity

S

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions