db.changelog.20210609-add-timestamp-to-active-environment.yml Maven / Gradle / Ivy
databaseChangeLog:
- changeSet:
id: add-timestamp-to-active-environment
author: fletch
preConditions:
- not:
columnExists:
tableName: active_environment_version
columnName: active_since
onFail: MARK_RAN
changes:
- addColumn:
tableName: active_environment_version
columns:
- name: active_since
type: datetime(3)
constraints:
nullable: true
- sql:
sql: |
update active_environment_version aev
set active_since = (
select created_at
from environment_version ev
where ev.environment_uid = aev.environment_uid
and ev.version = aev.active_version
);