2016-04-18 02:58:29 +02:00
|
|
|
package models
|
|
|
|
|
2016-05-24 11:55:48 +02:00
|
|
|
import "github.com/ansible-semaphore/semaphore/db"
|
2016-04-18 02:58:29 +02:00
|
|
|
|
|
|
|
func SetupDBLink() {
|
2016-05-24 11:55:48 +02:00
|
|
|
db.Mysql.AddTableWithName(APIToken{}, "user__token").SetKeys(false, "id")
|
|
|
|
db.Mysql.AddTableWithName(AccessKey{}, "access_key").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Environment{}, "project__environment").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Inventory{}, "project__inventory").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Project{}, "project").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Repository{}, "project__repository").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Task{}, "task").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(TaskOutput{}, "task__output").SetUniqueTogether("task_id", "time")
|
|
|
|
db.Mysql.AddTableWithName(Template{}, "project__template").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(User{}, "user").SetKeys(true, "id")
|
|
|
|
db.Mysql.AddTableWithName(Session{}, "session").SetKeys(true, "id")
|
2016-04-18 02:58:29 +02:00
|
|
|
}
|