MCPcopy
hub / github.com/github/gh-ost / GetGhostTableName

Method GetGhostTableName

go/base/context.go:372–382  ·  view source on GitHub ↗

GetGhostTableName generates the name of ghost table, based on original table name or a given table name

()

Source from the content-addressed store, hash-verified

370// GetGhostTableName generates the name of ghost table, based on original table name
371// or a given table name
372func (mctx *MigrationContext) GetGhostTableName() string {
373 if mctx.Revert {
374 // When reverting the "ghost" table is the _del table from the original migration.
375 return mctx.OldTableName
376 }
377 if mctx.ForceTmpTableName != "" {
378 return getSafeTableName(mctx.ForceTmpTableName, "gho")
379 } else {
380 return getSafeTableName(mctx.OriginalTableName, "gho")
381 }
382}
383
384// GetOldTableName generates the name of the "old" table, into which the original table is renamed.
385func (mctx *MigrationContext) GetOldTableName() string {

Callers 15

TestGetTableNamesFunction · 0.95
finalCleanupMethod · 0.80
prepareQueriesMethod · 0.80
CreateGhostTableMethod · 0.80
AlterGhostMethod · 0.80
CreateTriggersOnGhostMethod · 0.80

Calls 1

getSafeTableNameFunction · 0.85

Tested by 1

TestGetTableNamesFunction · 0.76