mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-15 11:00:56 +02:00
- Introduce new `skip_processed_files` option for transfer configurations - Add database migration to support the new column - Update config form and UI to include skip processed files toggle - Enhance scheduler to respect skip processed files setting - Modify file processing logic to optionally skip previously processed files - Add environment variable support for skip processed files configuration
22 lines
702 B
Go
22 lines
702 B
Go
package migrations
|
|
|
|
import (
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AddSkipProcessedFilesColumn adds the skip_processed_files column to transfer_configs table
|
|
func AddSkipProcessedFilesColumn() *gormigrate.Migration {
|
|
return &gormigrate.Migration{
|
|
ID: "20250310_add_skip_processed_files",
|
|
Migrate: func(tx *gorm.DB) error {
|
|
// Add skip_processed_files column with default value of true
|
|
return tx.Exec("ALTER TABLE transfer_configs ADD COLUMN skip_processed_files BOOLEAN DEFAULT true").Error
|
|
},
|
|
Rollback: func(tx *gorm.DB) error {
|
|
// Drop the column if needed
|
|
return tx.Exec("ALTER TABLE transfer_configs DROP COLUMN skip_processed_files").Error
|
|
},
|
|
}
|
|
}
|