feat/add-database #8
3 changed files with 15 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -129,4 +129,6 @@ fabric.properties
|
||||||
.idea/**/azureSettings.xml
|
.idea/**/azureSettings.xml
|
||||||
|
|
||||||
# Игнорируем папку uploads
|
# Игнорируем папку uploads
|
||||||
uploads
|
uploads
|
||||||
|
|
||||||
|
app.db
|
|
@ -29,11 +29,22 @@ const (
|
||||||
StatusCancelled // 4
|
StatusCancelled // 4
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type TaskType int
|
||||||
|
|
||||||
|
const (
|
||||||
|
// For future purpose
|
||||||
|
TypeTestOnly TaskType = iota // 0
|
||||||
|
TypeUpsert // 1
|
||||||
|
// For future purpose
|
||||||
|
TypeDelete // 2
|
||||||
|
)
|
||||||
|
|
||||||
type Task struct {
|
type Task struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
|
||||||
ID int
|
ID int
|
||||||
Status TaskStatus
|
Status TaskStatus
|
||||||
|
Type TaskType
|
||||||
|
|
||||||
RepoID int
|
RepoID int
|
||||||
Repo GitRepo
|
Repo GitRepo
|
||||||
|
|
|
@ -16,6 +16,7 @@ func (s *Service) Create(repo string) (*models.Task, error) {
|
||||||
task := models.Task{
|
task := models.Task{
|
||||||
RepoID: taskRepo.ID,
|
RepoID: taskRepo.ID,
|
||||||
ALTRepo: altRepo,
|
ALTRepo: altRepo,
|
||||||
|
Type: models.TypeUpsert,
|
||||||
}
|
}
|
||||||
|
|
||||||
result := s.app.Db.Create(&task)
|
result := s.app.Db.Create(&task)
|
||||||
|
|
Loading…
Reference in a new issue