# Deleting Schema

## 1. Overview

When a user attempts to delete a schema from the grid page, a modal window appears to confirm the action and display relevant dependency information.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-1ef5f1c6576100cf76bcf454371080ae7aea33eb%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Functional Details

### 2.1 Deleting Schemas with Child Schemas

When deleting a schema that has child schemas:

* The modal displays a list of all child schemas that can be deleted along with it.
* It also shows which child schemas cannot be deleted due to dependencies on other schemas.
* A checkbox allows the user to choose whether to:
* Delete only the selected schema, or
* Delete the selected scheme and all its child schemas.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-ef7546b613424a5b50d279011851a2f4902317c0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 2.2 Deleting Schemas with Parent Dependencies

If the selected schema depends on one or more parent schemas, deletion is not allowed.\
In this case:

* The modal displays a warning message explaining that the scheme cannot be deleted due to existing dependencies.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-89a61f92f90f1d907373a62d1b914ea0a806ffe4%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 2.3 Deleting all Schemas

User will now be able to delete all schemas for a particular policy by using "Delete All Schemas" button:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-01a773416480024eb641437f6c4a676bfdc11a54%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### 2.4 Delete Multiple Schemas

Added ability to select and delete items from schema table in Guardian UI.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2FkUYjMQw9xloe7XJUvvL3%2Fimage.png?alt=media&#x26;token=13c79dd9-2138-4ca7-bcba-afe6c5b0ca88" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Note:

1. Selected items remain selection across pagination.
2. Dependencies are considered when deleting multiple schemas.
   {% endhint %}
