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

barrel-migrations is broken #1864

Closed
SWW13 opened this Issue Sep 21, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@SWW13

SWW13 commented Sep 21, 2018

Setup

Versions

  • Rust: nightly (rustc 1.29.0 (aa3ca1994 2018-09-11))
  • Diesel: 1.3.3 / master
  • Database: psql
  • Operating System linux

Feature Flags

  • diesel: barrel-migrations,postgres

Problem Description

Using the barrel-migrations-feature is broken in the current diesel / barrel version.

What are you trying to accomplish?

Use diesel with barrel as described in https://github.com/spacekookie/barrel/blob/master/guides/diesel-setup.md.

What is the expected output?

Working migrations.

What is the actual output?

[diesel 1.3.3, barrel <= 0.2.0]

$ diesel migration run
Running migration mod.rs
Received an empty query

[diesel master, barrel master]

$ diesel migration run
Running migration mod.rs
Executing migration script /path/to/project/migrations/2018-09-21-125612_init_db/mod.rs/up.sql
Failed with: Received an empty query

Are you seeing any additional errors?

[diesel 1.3.3, barrel <= 0.2.0]
The temporary created migration project build fails silently in the background:

$ cargo build
   Compiling tmp-generator v0.0.0 (file:///tmp/barrel.nkunnkN46LTx)                                                                                                                                 
error: couldn't read "/path/to/project/migrations/2018-09-21-125612_init_db/mod.rs/mod.rs": Not a directory (os error 20)
 --> src/main.rs:8:1
  |
8 | include!("/path/to/project/migrations/2018-09-21-125612_init_db/mod.rs/mod.rs");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `tmp-generator`.

To learn more, run the command again with --verbose.

Steps to reproduce

Follow https://github.com/spacekookie/barrel/blob/master/guides/diesel-setup.md.

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be
    closed if this is not the case)
    You're kidding?! diesel_cli with barrel-migrations doesn't build on stable.

This seems to be a problem in combination with barrel, I'm going to investigate this further.

@sgrif

This comment has been minimized.

Member

sgrif commented Sep 21, 2018

Barrel is a separate project, and is not maintained by Diesel. Please open an issue with that project instead.

@sgrif sgrif closed this Sep 21, 2018

@spacekookie

This comment has been minimized.

Contributor

spacekookie commented Sep 21, 2018

There already is an issue. I doubt that it's actually the code in diesel that's causing the issue. But I'll have a look at it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment