| Age | Commit message (Collapse) | Author |
|
|
|
Add a new variable for the regular database URL, and move the existing
one, which includes the `tcp(hostname)` format to `GO_DATABASE_URL`. We
need to keep the existing one for use with the 'migrate' command, but I
want a regular database URL to be able to use inside the main web
program.
|
|
Wrap all `migrate` subcommands. Turns out we do need the `-path`
argument for the other commands. Doesn't appear to work correctly for
`create`, but for the others it works fine.
|
|
Wraps the `migrate` command (https://github.com/golang-migrate/migrate).
The command requires you to pass in a bunch of shell options that should
be constant for an application.
Encode those constants in this wrapper function. Now all you need to do
is run:
$ migrate migration_name
and the correct migrations will be generated.
The migrations get created in the current directory. I tried passing
-source file://migrations
,
-source file://./migrations
, and
-path migrations
but no combination seemed to put the generated migration files in the
migrations/ directory. Settled on moving the files manually in the
helper function.
|
|
Use 'migrant' for migrations (https://crates.io/crates/migrant).
TOML config file generated and modified from `migrant init`.
Database connection parameters should be passed in though environment
variables, hence the '.env.sample'.
|