-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed all components * added a migration to remove the chat variabnt from the cronjob * added the missing migration to the list of migrations
- Loading branch information
1 parent
65bfb78
commit f67c9bb
Showing
5 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package migration | ||
|
||
import ( | ||
"github.com/TUM-Dev/Campus-Backend/server/model" | ||
"github.com/go-gormigrate/gormigrate/v2" | ||
"gorm.io/gorm" | ||
) | ||
|
||
// migrate20230825000000 | ||
// Removes the ability to run chat cronjobs | ||
func (m TumDBMigrator) migrate20230825000000() *gormigrate.Migration { | ||
return &gormigrate.Migration{ | ||
ID: "20230825000000", | ||
Migrate: func(tx *gorm.DB) error { | ||
// deactivete the crontab (Rollback deletes this from the enum) | ||
// given that previously, not cronjobs for this type existed there is no need to remove offending entries first | ||
return SafeEnumRollback(tx, &model.Crontab{}, "type", "chat") | ||
}, | ||
Rollback: func(tx *gorm.DB) error { | ||
// activete the crontab (Migrate adds this from to the enum) | ||
// given that previously, not cronjobs for this type existed there is no need to add entries first | ||
return SafeEnumMigrate(tx, &model.Crontab{}, "type", "chat") | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters