Remove wrong column removal at catch block

This commit is contained in:
Joshen Lim committed 2023-04-14 10:56:51 +07:00
1 parent 8b5044e380
commit 9e6b239830
1 file changed
-3
-3
View File
@@ -405,7 +405,6 @@ export default class MetaStore implements IMetaStore {
try {
// Once pg-meta supports composite keys, we can remove this logic
const { isPrimaryKey, ...formattedPayload } = payload
const column: any = await this.columns.create(formattedPayload)
if (column.error) throw column.error
@@ -469,8 +468,6 @@ export default class MetaStore implements IMetaStore {
category: 'error',
message: `An error occurred while creating the column "${payload.name}"`,
})
const query = `alter table "${selectedTable.name}" drop column if exists "${payload.name}";`
await this.rootStore.meta.query(query)
return { error }
}
}