Add Column in liquibase is not idempotent

Description

If our Liquibase changelog is corrupted (which is really easy to do when you're working with multiple workspaces, or if you're iterating on a table), deleting the DATABASECHANGELOG and DATABASECHANGELOCK doesn't work because Liquibase will complain about columns already existing when you add a column. (See https://github.com/Sage-Bionetworks/BridgeServer2/blob/develop/src/main/resources/db/changelog/changelog.sql#L207)

We need our Add Column changesets to be idempotent, so that we can easily recover from a corrupted database.

Side note: Deleting all database tables and asking Liquibase to recreate everything is a huge pain. This is because we have no Templates, so we'd also have to nuke our Studies and StudyConsents and flush redis.

Environment

None

Status

Assignee

Alx Dark

Reporter

Dwayne Jeng

Labels

None

Validator

Erin Mounts

Release Version History

None

Components

Fix versions

Priority

Major
Configure