modify constraint

This commit is contained in:
divyam234 2023-09-11 11:40:03 +05:30
parent 173f06b030
commit fb9985d6f0
3 changed files with 12 additions and 3 deletions

View file

@ -0,0 +1,8 @@
-- +goose Up
-- +goose StatementBegin
ALTER TABLE teldrive.files DROP CONSTRAINT unique_file;
ALTER TABLE teldrive.files ADD CONSTRAINT unique_file UNIQUE (name, parent_id, user_id,status)
-- +goose StatementEnd

View file

@ -39,7 +39,9 @@ func main() {
scheduler := gocron.NewScheduler(time.UTC)
scheduler.Every(1).Hours().Do(cron.FilesDeleteJob)
scheduler.Every(1).Hour().Do(cron.FilesDeleteJob)
scheduler.StartAsync()
router.Use(cors.New(cors.Config{
AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"},
@ -67,5 +69,4 @@ func main() {
} else {
router.Run(fmt.Sprintf(":%d", config.Port))
}
scheduler.StartAsync()
}

@ -1 +1 @@
Subproject commit ee2f728020786599f2f6c9a4ab86f493b0ca19a7
Subproject commit 06f9a8b4cac51b199d8fab8be781461d51d8b876