Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move table space management from migration scripts #19

Merged
merged 4 commits into from
Jul 12, 2019

Conversation

githengi
Copy link
Contributor

Closes #18

unzip /tmp/mybatis-migrations-3.3.1-bundle.zip -d /opt/mybatis
export MIGRATIONS_HOME=/opt/mybatis/mybatis-migrations-3.3.1
MIGRATIONS=$MIGRATIONS_HOME/bin
export PATH=$MIGRATIONS:$PATH
migrate up --path=configs/assets/migrations --env=test --force
migrate up --path=configs/assets/migrations --env=test

Choose a reason for hiding this comment

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

@githengi how do you think we should test if the migrations are idempotent? Maybe run the migrate up command twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, yes sure will add that

@jasonrogena
Copy link

Looks good to me. Thanks @githengi . This now means that it's up to the deployments to create the tablespace directories, if they'd want tablespaces, right?

@githengi
Copy link
Contributor Author

Yes so if deployments use tablespaces the tables spaces are created out of migrations just like creating database, users and roles.

@jasonrogena
Copy link

Yes so if deployments use tablespaces the tables spaces are created out of migrations just like creating database, users and roles.

That's awesome, thanks!

@githengi githengi merged commit 7f4b474 into master Jul 12, 2019
@githengi githengi deleted the 18-remove-tablespaces-creation-from-migrations branch March 23, 2020 08:21
@mark-mngoma
Copy link

I get an Error: Cause: org.postgresql.util.PSQLException: ERROR: tablespace "opensrp_core" does not exist when I run MyBatis migrate up flagged with the dir config path, test migration worked. Only changelog has been created.

@githengi
Copy link
Contributor Author

you have to create tablespaces externally of migrations or map the tablespaces to the postgres default tablespace

@mark-mngoma
Copy link

mark-mngoma commented Apr 23, 2020 via email

@mark-mngoma
Copy link

mark-mngoma commented Apr 23, 2020 via email

@mark-mngoma
Copy link

mark-mngoma commented Apr 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only attempt to create tablespaces if they don't exist
3 participants