Skip to Content
Stoatly Docs
Object types

Change a schema safely

Changing a schema is easy. Changing it without breaking anything takes a little care, because records and generated code already depend on what's there. Stoatly shows what a change affects before you commit to it, and nothing reaches your repository until you send a pull request. Below are the gentle changes and the risky ones. Admins and schema designers make these changes.

Gentle changes

These don't break existing records or code.

  • Adding a field, a group, a formula or a visual.
  • Adding an enum value.
  • Renaming a label. The key stays the same, so files and code keep working.
  • Reordering fields and groups.
  • Deprecating a field or an enum value. The data stays and the item is marked deprecated.

Changes that remove data

  • Deleting a field removes its values from every record when the pull request merges. Stoatly shows how many records hold a value in it first.
  • Deleting an object type removes all of its records and its folder from the repository. Stoatly counts the records, and lists any records of other types that point at it.
  • Deleting a record can leave other records pointing at nothing.
  • Deleting an enum leaves the fields that used it without a type.

If you want to retire something without losing data, deprecate it or mark an object type obsolete instead.

Changes that can break your game's code

The generated C# follows the schema, so some changes show up as compile errors in your project.

  • Deleting a field or an enum removes the matching property or type.
  • Changing the C# name of a shipped enum value breaks code that used the old name. Stoatly lists the files in your repository that mention it.
  • Deprecating an enum value marks the member [Obsolete], which produces warnings, not errors.

Changing a field's type isn't allowed. Add a new field of the right type, move your data across, then deprecate the old one.

Changes that other people's work can collide with

Teammates keep editing while your pull request is open. When it merges, their drafts are checked against the new schema. A record that used a field you removed, or a value that breaks a new rule such as a maximum, is flagged as No longer applies in their changes. Tightening a rule, making a field required or removing an enum value are the most likely to do this. When a pull request merges describes what teammates see.

Check before you send

  • Read the impact notice on each delete or deprecate dialog. It counts the records affected.
  • Look over Your changes for anything you didn't intend.
  • Prefer several small pull requests over one large one, so a problem is easy to trace.

On this page