The database db-reset can choke on down migration from 2 to 1 when email is NULL
I had a problem to down migrate my database with the stork-tool
because of the following:
$ ./stork-tool db-reset --db-host=/tmp
INFO[2024-11-12 11:36:11] main.go:138 SQL queries tracing set to none
INFO[2024-11-12 11:36:11] connection.go:90 Checking connection to database
ERRO[2024-11-12 11:36:11] connection.go:108 Invalid database credentials (authentication error) error="unable to connect to the database using provided settings: FATAL #28P01 password authentication failed for user \"stork\""
database password for user stork:
INFO[2024-11-12 11:36:12] connection.go:155 Connected to database /tmp/.s.PGSQL.5432
WARN: pg: 2024/11/12 11:36:12 SystemUserToGroup.UserID has unknown tag option: "not_null"
WARN: pg: 2024/11/12 11:36:12 SystemUserToGroup.GroupID has unknown tag option: "not_null"
DEPRECATED: pg: 2024/11/12 11:36:12 add pg:"rel:has-one" to SystemUserToGroup.User field tag
DEPRECATED: pg: 2024/11/12 11:36:12 add pg:"rel:has-one" to SystemUserToGroup.Group field tag
FATA[2024-11-12 11:36:12] main.go:152 Failed to migrate database error="problem migrating database, old: 60, new: 0: ERROR #23502 column \"email\" of relation \"system_user\" contains null values"
If your database contains user accounts with NULL passwords, an attempt to add constraint on the email column fails.