GetGhostTableName generates the name of ghost table, based on original table name or a given table name
()
| 370 | // GetGhostTableName generates the name of ghost table, based on original table name |
| 371 | // or a given table name |
| 372 | func (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. |
| 385 | func (mctx *MigrationContext) GetOldTableName() string { |