-
Notifications
You must be signed in to change notification settings - Fork 70
Description
The credentials for the database are configurable in secrets/fragmenta.json
. However, the default migrations in db/migrations/*.sql
also contain hard-coded usernames & passwords.
Why not simply create the user and database itself from the info in secrets/fragmenta.json
? That would remove the need to have usernames & passwords in xxxx-Create-Database.sql
.
When connecting to the database to perform migrations, wouldn't tables already be owned by the creating user? If I'm right in that, all the ALTER TABLE xxx OWNER TO "yyy";
lines can be removed from xxx-Create-Tables.sql
.
Of course this requires the database connection to be made with the correct credentials, which might not be the case (see fragmenta/fragmenta#32).
Furthermore, I believe that migrations are files that should be loadable on any installation of the site, while the username/password credentials are installation-specific. This is exacerbated by the fact that test, development, and deploy configurations in secrets/fragmenta.json
can be configured to use different usernames. Having those usernames hard-coded in the migration files makes no sense.