Skip to Content
Stoatly Docs
Object types

Delete or retire an object type

You can retire an object type, which hides it and keeps everything working, or delete it, which removes it and all of its records from your repository. Deleting can't be undone once the pull request merges, so Stoatly shows what it affects first. You'll find both options at the bottom of the object type's page, and you'll need to be an admin or a schema designer.

Which one to use

You want toUse
Stop showing a type that's no longer used, without breaking anythingMark as obsolete
Remove a type that shipped, and its recordsDelete via PR
Throw away a type you made and never sentDelete draft
The bottom of an object type page, with the Obsolete card and the Delete via PR card.

Mark a type as obsolete

Marking a type obsolete signals that it's retired. It stays in your repository and its fields and records keep working. Use it when something has shipped in a game and you want to stop new work on it.

Open the type

Open the object type and scroll to the Obsolete card at the bottom of the page.

Choose Mark as obsolete

A confirmation says the type will be marked obsolete, that its child object types and their records will be marked obsolete too, and that you can undo it.

Confirm

Choose Mark as obsolete.

An obsolete type is hidden from the Objects page by default, and its class in the generated C# is marked [Obsolete], so code that uses it gets a compiler warning. The page shows "This Object Type is Obsolete". Choose Remove obsolete to bring it back.

Delete a type that has shipped

Deleting a type that's in your repository goes through a pull request, like any other change.

Choose Mark for deletion

Open the type and use the Delete via PR card at the bottom of the page. A confirmation opens.

Read what it affects

The confirmation says how many records are removed with the type. If records of other types point at it, it names the fields and counts the records. If other object types inherit from it, it lists them and warns that their parent will point at a deleted type until you deal with them.

Confirm

Choose Mark for deletion. The type is now queued for deletion. The page says so, and offers Cancel deletion until you send it.

Send it in a pull request

Open Your changes, where the deletion appears under Schema, and create a pull request. When the pull request merges, the type's whole folder is removed from the repository, including every record and the schema file.

Deleting a type deletes its records, and the generated C# class goes with it, so code that uses it stops compiling. Change or remove the parent of any child types first, and update or remove references to it.

Delete a type you never sent

A type that has only ever been in your draft has nothing in the repository to remove. The Delete draft card removes it straight away, along with its fields and every draft record, and no pull request is needed. This can't be undone.

Stoatly refuses in two cases:

  • The type is new in an open pull request. Close or merge that pull request first.
  • Other object types inherit from it. Move or discard them first.

For the wider picture of which changes lose data and which break code, see Change a schema safely.

On this page