Tournament Auto Migration

Report a typo

Emma wants to run the first migration of the tournament database schema, she has already created the Team, Player, and Game models.

Your task is to help Emma to add the missing code with the correct function to run an Auto Migration on the above models!

Write a program in Go
package main

import (
"fmt"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"time"
)

// DO NOT modify the 'tournament' models below:
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
}

___

Create a free account to access the full topic