Adding 'Remote migration files' sub-section.

This commit is contained in:
Maxime Delporte
2025-11-06 10:17:12 +01:00
parent 6997490335
commit 0874a6aac4

View File

@@ -158,6 +158,18 @@ $ migrate -path=./migrations -database=$EXAMPLE_DSN force 1
Once you force the version, the database is considered 'clean' and you should be able to run migrations again without any problem.
### Remote migration files
The migrate tool also supports reading migration files from remote sources including Amazon S3 and GitHub repositories. For example :
```bash
$ migrate -source="s3://<bucket>/<path" -database=$EXAMPLE_DSN up
$ migrate -source="github://owner/repo/path#ref" -database=$EXAMPLE_DSN up
$ migrate -source="github://user:personal-access-token@owner/repo/path#ref" -database=$EXAMPLE_DSN up
```
More information about this functionality and a full list of the supported remote resources can be [found here](https://github.com/golang-migrate/migrate#migration-sources).
## Additional Information
### How different Go Types are encoded