databaseChangeLog:
  - logicalFilePath: db-changelog-000308-add-total-sync-rows-to-replica_load_event.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-000308'
      tagDatabase:
        tag: 'pre-000308'
  - changeSet:
      author: appian
      id: '000308.1.0'
      comment: Add total_source_rows_to_sync to replica_load_event table
      addColumn:
        tableName: replica_load_event
        columns:
          - column:
              name: total_source_rows_to_sync
              type: ${integerType}
              constraints:
                nullable: true
  - changeSet:
      author: appian
      id: '000308.1.1'
      comment: Rename column source_rows_read to total_source_rows
      changes:
        - renameColumn:
            columnDataType: ${integerType}
            newColumnName: total_source_rows
            oldColumnName: source_rows_read
            tableName: replica_load_event
  - changeSet:
      author: appian
      id: '000308.1.2'
      comment: Default total_source_rows_to_sync from replica_rows_written
      sql: UPDATE replica_load_event SET total_source_rows_to_sync = replica_rows_written;
