Semaphore/db/models.go
tom whiston 17fa7bb407 add gometalinter to tools and run it in circle.
extract some error checking and logging in places where linting needed or errors not checked
2018-04-05 21:24:19 +00:00

17 lines
957 B
Go

package db
// SetupDBLink is called by main after initialization of the Mysql object to create or return an existing table map
func SetupDBLink() {
Mysql.AddTableWithName(APIToken{}, "user__token").SetKeys(false, "id")
Mysql.AddTableWithName(AccessKey{}, "access_key").SetKeys(true, "id")
Mysql.AddTableWithName(Environment{}, "project__environment").SetKeys(true, "id")
Mysql.AddTableWithName(Inventory{}, "project__inventory").SetKeys(true, "id")
Mysql.AddTableWithName(Project{}, "project").SetKeys(true, "id")
Mysql.AddTableWithName(Repository{}, "project__repository").SetKeys(true, "id")
Mysql.AddTableWithName(Task{}, "task").SetKeys(true, "id")
Mysql.AddTableWithName(TaskOutput{}, "task__output").SetUniqueTogether("task_id", "time")
Mysql.AddTableWithName(Template{}, "project__template").SetKeys(true, "id")
Mysql.AddTableWithName(User{}, "user").SetKeys(true, "id")
Mysql.AddTableWithName(Session{}, "session").SetKeys(true, "id")
}