# Forge SQL: How to drop table and Delete the schema in forge SQL storage

**URL:** <https://community.developer.atlassian.com/t/forge-sql-how-to-drop-table-and-delete-the-schema-in-forge-sql-storage/90158>\
**Category:** Forge UI Kit and Custom UI\
**Created:** [March 12, 2025, 10:40am UTC](https://community.developer.atlassian.com/t/forge-sql-how-to-drop-table-and-delete-the-schema-in-forge-sql-storage/90158 "2025-03-12T10:40:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KiranVinayagam](https://avatars.discourse-cdn.com/v4/letter/k/5e9695/32.png) [@KiranVinayagam](https://community.developer.atlassian.com/u/KiranVinayagam)\
**Post date:** [March 12, 2025, 10:40am UTC](https://community.developer.atlassian.com/t/forge-sql-how-to-drop-table-and-delete-the-schema-in-forge-sql-storage/90158/1 "2025-03-12T10:40:40Z")

</div>

Hi,

Recently, I have been using the Forge SQL storage method ([https://developer.atlassian.com/platform/forge/storage-reference/sql/](https://developer.atlassian.com/platform/forge/storage-reference/sql/)) for one of my apps. While developing, I had to take a lot of trial and error methods, which ended up creating junk schemas and tables. So, I need to delete these schemas and tables.

```auto
export const CREATE_CHECKLIST_TABLE = `CREATE TABLE IF NOT EXISTS Checklist (
    id INT PRIMARY KEY AUTO_INCREMENT,
    customFieldOption_id VARCHAR(100),
    customField_id VARCHAR(100),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
    created_by VARCHAR(100) NOT NULL,
    updated_at DATE,
    updated_by VARCHAR(100)
)`;

```

This is the schema that needs to be deleted, and `Checklist` is the table name that has to be dropped. I tried to drop the table, but it’s throwing an error like this:

```auto
ForgeSQLAPIError [ForgeSQLError]: Unknown SQL execution error
    at checkResponseError (webpack://jira-issue-panel-custom-ui/node_modules/@forge/sql/out/utils/error-handling.js:29:1)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async SqlClient.storageApi (webpack://jira-issue-panel-custom-ui/node_modules/@forge/sql/out/sql.js:29:1)
    at async SqlClient.storageApiWithOptions (webpack://jira-issue-panel-custom-ui/node_modules/@forge/sql/out/sql.js:40:1)
    at async SqlClient.executeRaw (webpack://jira-issue-panel-custom-ui/node_modules/@forge/sql/out/sql.js:47:1) {
  responseDetails: { status: 400, statusText: 'Bad Request', traceId: null },
  code: 'SQL_EXECUTION_ERROR',
  suggestion: 'There was an error while executing the given command. Find more information about the SQL execution error in the "debug" field',
  context: {
    debug: {
      message: "DROP command denied to user 'forge_e9_e15d01665b85f8939d4_DML'@'%' for table 'checklist'",
      code: 'ER_TABLEACCESS_DENIED_ERROR',
      errno: 1142,
      sql: 'DROP TABLE Checklist',
      sqlState: '42000',
      sqlMessage: "DROP command denied to user 'forge_e9_e15d01665_DML'@'%' for table 'checklist'"
    },
    queryType: 'other'
  }
}

```

Any input will be helpful.

Thanks.  
Kiran .V

---

<div class="post-metadata">

**Author:** ![AaronCollier](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@AaronCollier](https://community.developer.atlassian.com/u/AaronCollier)\
**Post date:** [April 4, 2025, 6:24am UTC](https://community.developer.atlassian.com/t/forge-sql-how-to-drop-table-and-delete-the-schema-in-forge-sql-storage/90158/2 "2025-04-04T06:24:33Z")

</div>

To drop and add tables and other things that involve the database schema, you need to run migration events: [https://developer.atlassian.com/platform/forge/storage-reference/sql-api-schema/](https://developer.atlassian.com/platform/forge/storage-reference/sql-api-schema/)

---

<div class="post-metadata">

**Author:** ![KiranVinayagam](https://avatars.discourse-cdn.com/v4/letter/k/5e9695/32.png) [@KiranVinayagam](https://community.developer.atlassian.com/u/KiranVinayagam)\
**Post date:** [April 7, 2025, 5:10am UTC](https://community.developer.atlassian.com/t/forge-sql-how-to-drop-table-and-delete-the-schema-in-forge-sql-storage/90158/3 "2025-04-07T05:10:38Z")

</div>

Hi @AaronCollier,

Thanks for the solution.
