sequel-rake-migrations 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +30 -8
- data/lib/sequel/rake/migrations/version.rb +1 -1
- data/lib/tasks/db.rake +1 -0
- data/sequel-rake-migrations.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75622aae0493ad3175572970ea5dafe174a47087
|
4
|
+
data.tar.gz: 30e906bb11164bbc200db636a3a1134054233073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27bc271904ecb91b00a4924db5f069cf9ba43d5c6dc68ba2bac08de6bc8c42f92a1001ccdff149785ca1a870e8daee4d44847d2b5a904da48f3a95ef5e19bf45
|
7
|
+
data.tar.gz: 1f6e9a6ae468beb22d9a294c8c5a5d35cdb1517d40ce4f057b504a83dae5f6b77bb2aabb4fc69c40639324a3e76fe0022938b835b191a420304eceadd4470983
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# Sequel::Rake::Migrations
|
1
|
+
# Sequel::Rake::Migrations
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Migration Rake tasks for [Sequel](http://sequel.jeremyevans.net/).
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -16,13 +14,37 @@ And then execute:
|
|
16
14
|
|
17
15
|
$ bundle
|
18
16
|
|
19
|
-
|
17
|
+
Require the tasks at the top of your Rakefile
|
20
18
|
|
21
|
-
|
19
|
+
```ruby
|
20
|
+
require "sequel/rake/migrations/tasks"
|
21
|
+
```
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Sequel is loaded with DATABASE_URL and TEST_DATABASE_URL environment variables. `ENV["APP_ENV"]` is used to determine current environment ([sinatra#984](https://github.com/sinatra/sinatra/pull/984)).
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
DB = Sequel.connect(ENV["APP_ENV"] == "test" ? ENV["TEST_DATABASE_URL"] : ENV["DATABASE_URL"])
|
29
|
+
```
|
30
|
+
|
31
|
+
### Available Rake Tasks
|
32
|
+
|
33
|
+
```sh
|
34
|
+
# Create dev + test databases
|
35
|
+
$ bin/rake db:create
|
36
|
+
|
37
|
+
# Create a migration
|
38
|
+
$ bin/rake db:create_migration["create_accounts"]
|
39
|
+
|
40
|
+
# Run migrations
|
41
|
+
$ bin/rake db:migrate
|
42
|
+
$ bin/rake db:migrate APP_ENV=test
|
43
|
+
|
44
|
+
# Rollback
|
45
|
+
$ bin/rake db:rollback
|
46
|
+
$ bin/rake db:rollback APP_ENV=test
|
47
|
+
```
|
26
48
|
|
27
49
|
## Development
|
28
50
|
|
@@ -32,7 +54,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
54
|
|
33
55
|
## Contributing
|
34
56
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
57
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dawsonandrews/sequel-rake-migrations.
|
36
58
|
|
37
59
|
## License
|
38
60
|
|
data/lib/tasks/db.rake
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_runtime_dependency "sequel", "~> 4.44.0"
|
25
|
+
spec.add_runtime_dependency "dotenv"
|
25
26
|
|
26
27
|
spec.add_development_dependency "bundler", "~> 1.15"
|
27
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-rake-migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Hawkins
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.44.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dotenv
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|