feat: add database #7

Merged
maks1ms merged 7 commits from feat/add-database into main 2024-12-14 08:35:46 +00:00
3 changed files with 15 additions and 1 deletions
Showing only changes of commit 32b99f4f11 - Show all commits

2
.gitignore vendored
View file

@ -130,3 +130,5 @@ fabric.properties
# Игнорируем папку uploads
uploads
app.db

View file

@ -29,11 +29,22 @@ const (
StatusCancelled // 4
)
type TaskType int
const (
// For future purpose
TypeTestOnly TaskType = iota // 0
TypeUpsert // 1
// For future purpose
TypeDelete // 2
)
type Task struct {
gorm.Model
ID int
Status TaskStatus
Type TaskType
RepoID int
Repo GitRepo

View file

@ -16,6 +16,7 @@ func (s *Service) Create(repo string) (*models.Task, error) {
task := models.Task{
RepoID: taskRepo.ID,
ALTRepo: altRepo,
Type: models.TypeUpsert,
}
result := s.app.Db.Create(&task)