Skip to content

Database user is configurable but hard-coded in migrations #44

@sybrenstuvel

Description

@sybrenstuvel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions