mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-07 06:56:48 +08:00
modify constraint
This commit is contained in:
parent
173f06b030
commit
fb9985d6f0
3 changed files with 12 additions and 3 deletions
8
database/migrations/20230911113331_alter_table.sql
Normal file
8
database/migrations/20230911113331_alter_table.sql
Normal 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
|
5
main.go
5
main.go
|
@ -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
|
Loading…
Add table
Reference in a new issue