Skip to content

Support relation deprecation in schema #2396

@ecordell

Description

@ecordell

Problem Statement

Downstream SpiceDB consumers may not be the same groups of people maintaining the schema. It would be useful to have some tooling to help folks roll out phased migrations of the schema itself.

Solution Brainstorm

This is pure strawman, just getting something on paper:

definition document {
   @deprecated(warn)
   relation group: group

   @deprecated(error)
   relation folder: folder
}

In this example, writing document:foo#group@group:bar would result in a warning on write (i.e. document#group has been marked deprecated, please migrate away) but would still write the relationship to the datastore. Writing to document:foo#folder@folder:bar would result in a write error (document#foo has been disabled) and would not write to the datastore.

A relation can be phased out by:

  • Marking it as deprecated(warn)
  • Waiting for users to notice / migrate away
  • Marking it as deprecated(error) so that no new data can be written
  • Deleting all existing relationships for that relation
  • Removing the relation from the schema

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions