Hi,
Recently, I have been using the Forge SQL storage method (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.
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:
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