Skip to content

Commit

Permalink
fix(archive): Fix bug in migrating cluster name. Fixes argoproj#2272 (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Feb 20, 2020
1 parent fb0acbb commit c33f6cd
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 @@ -130,7 +130,7 @@ func (m migrate) Exec(ctx context.Context) error {
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
ansiSQLChange(`update argo_archived_workflows set clustername = ` + m.clusterName + ` where clustername is null`),
ansiSQLChange(`update argo_archived_workflows set clustername = '` + m.clusterName + `' where clustername is null`),
ternary(dbType == MySQL,
ansiSQLChange(`alter table argo_archived_workflows modify column clustername varchar(64) not null`),
ansiSQLChange(`alter table argo_archived_workflows alter column clustername set not null`),
Expand All @@ -157,7 +157,7 @@ func (m migrate) Exec(ctx context.Context) error {
ansiSQLChange(`alter table `+m.tableName+` alter column namespace set not null`),
),
ansiSQLChange(`alter table ` + m.tableName + ` add column clustername varchar(64)`), // DNS cannot be longer than 64 bytes
ansiSQLChange(`update ` + m.tableName + ` set clustername = ` + m.clusterName + ` where clustername is null`),
ansiSQLChange(`update ` + m.tableName + ` set clustername = '` + m.clusterName + `' where clustername is null`),
ternary(dbType == MySQL,
ansiSQLChange(`alter table `+m.tableName+` modify column clustername varchar(64) not null`),
ansiSQLChange(`alter table `+m.tableName+` alter column clustername set not null`),
Expand Down

0 comments on commit c33f6cd

Please sign in to comment.