1. Deleting tables in a transaction, as opposed to just a task.
2. Added transaction where it was supposed to be. However, it is not enough, the logic is still broken there...
First, do not use `.catch` before `.then`. It is dangerous without good understanding how it actually works.
Check this out:
```js
.catch(error => {
if (error.code === PostgresRelationDoesNotExistError) {
return this.createClass(className, {fields: {[fieldName]: type}}) // this gets into the following `.then`
} else if (error.code === PostgresDuplicateColumnError) {
// Column already exists, created by other request. Carry on to
// See if it's the right type.
// this will get the following `.then` with `undefined` as the value
} else {
throw error;
}
})
```