Skip to content

Commit

Permalink
fix default null value for timestamp column - MySQL 5.7 (argoproj#2933)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashkanna committed May 2, 2020
1 parent 9773cfe commit f32cec3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions persist/sqldb/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ func (m migrate) Exec(ctx context.Context) error {
ansiSQLChange(`alter table argo_archived_workflows alter column workflow set not null`),
),
ternary(dbType == MySQL,
ansiSQLChange(`alter table argo_archived_workflows modify column startedat timestamp not null`),
ansiSQLChange(`alter table argo_archived_workflows modify column startedat timestamp not null default CURRENT_TIMESTAMP`),
ansiSQLChange(`alter table argo_archived_workflows alter column startedat set not null`),
),
ternary(dbType == MySQL,
ansiSQLChange(`alter table argo_archived_workflows modify column finishedat timestamp not null`),
ansiSQLChange(`alter table argo_archived_workflows modify column finishedat timestamp not null default CURRENT_TIMESTAMP`),
ansiSQLChange(`alter table argo_archived_workflows alter column finishedat set not null`),
),
ansiSQLChange(`alter table argo_archived_workflows add clustername varchar(64)`), // DNS entry can only be max 63 bytes
Expand Down

0 comments on commit f32cec3

Please sign in to comment.