Bonjour,
Although goff is not yet ready to replace the current code for migrations in Gitea, a draft implementation was started to find out as soon as possible the pain points. In theory it should go like this.
The following are removed because they are redundant with goff:
- modules/migrations
- services/migrations except for a few exceptions below
The following are modified to use goff:
-
gitea_uploader.go
- Adjust abstract methods to gofff naming and types (CreateRepository becomes CreateProject, etc.)
- Implement CreateRepositories
- CreatePullRequests refactored to not use the result of CreateRepositories
-
dump.go and restore.go are removed except for two functions:
- RestoreRepository to build a gofff downloader to read from file and a gitea_uploader
- DumpRepository to use only gofff only
- migrate.go is removed except for the MigrateRepository function to use a gofff downloader
- forgeignreferences to have the same fields as gofff ForeignReferences table
The following are left untouched:
- migrate API endpoint
- dump-repo CLI
- restore-repo CLI which calls modules.private.RestoreRepo which calls routers.private.RestoreRepo which calls migrations.RestoreRepository
- dump / restore integration tests
To be continued