Independent migrations

Report a typo

Emma has created the tournament database schema using the following models:

type Team struct { // Model of the `teams` table
    gorm.Model
    Name string
}

type Player struct { // Model of the `players` table
    gorm.Model
    FirstName string
    LastName  string
    Age       int
    TeamID    uint
}

type Game struct { // Model of the `games` table
    gorm.Model
    TeamID        uint
    HomeTeam      Team
    HomeTeamID    uint
    HomeTeamScore uint
    AwayTeam      Team
    AwayTeamID    uint
    AwayTeamScore uint
    Date          time.Time
}

Now Emma wants to run two single migrations using the db.Migrator() interface to propagate the following changes:

  1. Change the name of the games table to matches;
  2. Remove the age column in the players table.

Your task is to help Emma select from below the two (2) correct code lines required to achieve the objectives above.

Select one or more options from the list
___

Create a free account to access the full topic