Skip to content

docker: use --locked-schema for diesel migrations #1637

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

Merged
merged 1 commit into from
Feb 24, 2019

Conversation

bryanburgers
Copy link
Contributor

When using docker-compose up to bring up everything for development,
we mount the source directory as read-only so that changes can only
happen on the host machine and not because of something that the code
running in docker does.

This read-only mount was causing problems because patch, called by
diesel migration run, would try to write to the filesystem and fail.

When bringing up a docker environment for the first time from a fresh
clone, we expect that the schema.rs file is already pristine, and that
we just need to run migrations. For that reason, use diesel migration run's --locked-schema option to just run migrations.

This change makes it so that a new contributor can clone the repo, run
docker-compose up, and have an almost complete environment to poke at
and start exploring.

Fixes #1631

When using `docker-compose up` to bring up everything for development,
we mount the source directory as read-only so that changes can only
happen on the host machine and not because of something that the code
running in docker does.

This read-only mount was causing problems because `patch`, called by
`diesel migration run`, would try to write to the filesystem and fail.

When bringing up a docker environment for the first time from a fresh
clone, we expect that the schema.rs file is already pristine, and that
we just need to run migrations. For that reason, use `diesel migration
run`'s `--locked-schema` option to just run migrations.

This change makes it so that a new contributor can clone the repo, run
`docker-compose up`, and have an almost complete environment to poke at
and start exploring.

Fixes rust-lang#1631
@bryanburgers
Copy link
Contributor Author

This merge request and #1632 which I also opened are similar in scope – getting the docker-compose stuff into a working and usable state.

Let me know if they should be combined into a single merge request.

@jtgeibel
Copy link
Member

LGTM, thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Feb 24, 2019

📌 Commit ab399e2 has been approved by jtgeibel

bors added a commit that referenced this pull request Feb 24, 2019
…ibel

docker: use --locked-schema for diesel migrations

When using `docker-compose up` to bring up everything for development,
we mount the source directory as read-only so that changes can only
happen on the host machine and not because of something that the code
running in docker does.

This read-only mount was causing problems because `patch`, called by
`diesel migration run`, would try to write to the filesystem and fail.

When bringing up a docker environment for the first time from a fresh
clone, we expect that the schema.rs file is already pristine, and that
we just need to run migrations. For that reason, use `diesel migration
run`'s `--locked-schema` option to just run migrations.

This change makes it so that a new contributor can clone the repo, run
`docker-compose up`, and have an almost complete environment to poke at
and start exploring.

Fixes #1631
@bors
Copy link
Contributor

bors commented Feb 24, 2019

⌛ Testing commit ab399e2 with merge 0f1ae4e...

@bors
Copy link
Contributor

bors commented Feb 24, 2019

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing 0f1ae4e to master...

@bors bors merged commit ab399e2 into rust-lang:master Feb 24, 2019
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.

3 participants