Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Allowing to skip schema load #1094

Merged
merged 4 commits into from
Jun 9, 2018

Conversation

paganotoni
Copy link
Member

In some situations, the database user configured in the database connection is not the owner of the plpgsql extension, and Postgres ends up saying when we try to load the schema file.

Error: unable to load schema for application_test: pq: must be owner of extension plpgsql

This PR allows to skip schema load and go straight to migrations.


func init() {
decorate("test", testCmd)
testCmd.Flags().BoolVarP(&buildOptions.ExtractAssets, "skip-schema-load", "s", false, "skips loading the schema and instead runs migrations before running tests")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of the name of this flag. Any other options?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy! ouch! going for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markbates what about "forceMigrations" and -m --force-migrations ?

@paganotoni
Copy link
Member Author

@markbates moved the variable to be forceMigrations (-m and --force-migrations in the cli).

@markbates markbates merged commit 257cc83 into development Jun 9, 2018
@markbates markbates deleted the feature/allow-skipping-schema-load-on-tests branch June 9, 2018 19:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants