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

Check that db/ exists before running db:schema:load #157

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

olivierlacan
Copy link

Note: I promise I'm not trying to DDoS you with Pull Requests. :-)

This is essentially the same issue as #156. An easy fix and useful
feedback for users who created a Rails app without ActiveRecord and
will not have any db/ directory.

The feedback is:

$ bin/rails db:schema:dump
The db/ directory doesn't exist, please create it.

Compare to what happened before this commit:

$ bin/rails db:schema:dump
rails aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - .../sandbox/appname/db/schema.rb
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `initialize'
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `open'
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `block (3 levels) in <top (required)>'
.../sandbox/appname/bin/rails:9:in `require'
.../sandbox/appname/bin/rails:9:in `<top (required)>'
.../sandbox/appname/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:schema:dump
(See full trace by running task with --trace)

This is essentially the same issue as TalentBox#156. An easy fix and useful
feedback for users who created a Rails app without ActiveRecord and
will not have any `db/` directory.

The feedback is:

```
$ bin/rails db:schema:dump
The db/ directory doesn't exist, please create it.
```

Compare to what happened before this commit:

```
$ bin/rails db:schema:dump
rails aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - .../sandbox/appname/db/schema.rb
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `initialize'
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `open'
.../oss/sequel-rails/lib/sequel_rails/railties/database.rake:26:in `block (3 levels) in <top (required)>'
.../sandbox/appname/bin/rails:9:in `require'
.../sandbox/appname/bin/rails:9:in `<top (required)>'
.../sandbox/appname/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:schema:dump
(See full trace by running task with --trace)
```
@JonathanTron
Copy link
Member

@olivierlacan Don't hesitate to DDoS the PR with your great contributions. Thanks again.

@JonathanTron JonathanTron merged commit 49d0c8d into TalentBox:master Feb 26, 2018
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.

2 participants