From bf0c13b46d1184039fda0e23f73d0448e108f09a Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Tue, 7 Jun 2022 01:47:51 +0200 Subject: [PATCH 1/2] Add table comment to changelog --- go/logic/applier.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/go/logic/applier.go b/go/logic/applier.go index 9bd2ba8..cb1898d 100644 --- a/go/logic/applier.go +++ b/go/logic/applier.go @@ -1,5 +1,5 @@ /* - Copyright 2021 GitHub Inc. + Copyright 2022 GitHub Inc. See https://github.com/github/gh-ost/blob/master/LICENSE */ @@ -22,6 +22,7 @@ import ( ) const ( + GhostChangelogComment = "gh-ost changelog" atomicCutOverMagicHint = "ghost-cut-over-sentry" ) @@ -233,16 +234,16 @@ func (this *Applier) CreateChangelogTable() error { return err } query := fmt.Sprintf(`create /* gh-ost */ table %s.%s ( - id bigint auto_increment, + id bigint unsigned auto_increment, last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, hint varchar(64) charset ascii not null, value varchar(4096) charset ascii not null, primary key(id), unique key hint_uidx(hint) - ) auto_increment=256 - `, + ) auto_increment=256 comment='%s'`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.GetChangelogTableName()), + GhostChangelogComment, ) this.migrationContext.Log.Infof("Creating changelog table %s.%s", sql.EscapeName(this.migrationContext.DatabaseName), From 387b32594e8c528ff3ca36cf789f3c27ce451a74 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Tue, 7 Jun 2022 01:49:18 +0200 Subject: [PATCH 2/2] Var rename --- go/logic/applier.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/logic/applier.go b/go/logic/applier.go index cb1898d..7114083 100644 --- a/go/logic/applier.go +++ b/go/logic/applier.go @@ -22,8 +22,8 @@ import ( ) const ( - GhostChangelogComment = "gh-ost changelog" - atomicCutOverMagicHint = "ghost-cut-over-sentry" + GhostChangelogTableComment = "gh-ost changelog" + atomicCutOverMagicHint = "ghost-cut-over-sentry" ) type dmlBuildResult struct { @@ -243,7 +243,7 @@ func (this *Applier) CreateChangelogTable() error { ) auto_increment=256 comment='%s'`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.GetChangelogTableName()), - GhostChangelogComment, + GhostChangelogTableComment, ) this.migrationContext.Log.Infof("Creating changelog table %s.%s", sql.EscapeName(this.migrationContext.DatabaseName),