db.changelog.20210302-drop-old-event-columns.yml Maven / Gradle / Ivy
databaseChangeLog:
- changeSet:
id: generate-event-timestamp
author: fletch
changes:
- dropColumn:
tableName: event
columnName: ref
- dropColumn:
tableName: event
columnName: timestamp
- sql:
sql: |
alter table event
change ref_gen ref varchar(255) generated always as (json ->> '$.ref')
not null;
- sql:
sql: |
alter table event
change timestamp_gen timestamp datetime(3) generated always as (str_to_date(json->>'$.timestamp', '%Y-%m-%dT%T.%fZ'));