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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9568338969c2a1af296dbb4206d154770f187a1a
4
- data.tar.gz: 95ac2881eabf07b462adeef8200e30d411807ceb
3
+ metadata.gz: 75622aae0493ad3175572970ea5dafe174a47087
4
+ data.tar.gz: 30e906bb11164bbc200db636a3a1134054233073
5
5
  SHA512:
6
- metadata.gz: ec2d5103b1a75af2cba3a95746b26ffc037c98429d255d3af8c840bc2e71c3e55b33c074502b2bd19205635c84fc05ec91a556151e4f309a0ca603d3d3ca314b
7
- data.tar.gz: d555fba89b105d409582d3aba9445536c8db82ff8571f49da6876da18fc0f3d4dbe46cc84f36cfb23e27bd7a625f388a10f930a8698b77491324bf31ccf9d73b
6
+ metadata.gz: 27bc271904ecb91b00a4924db5f069cf9ba43d5c6dc68ba2bac08de6bc8c42f92a1001ccdff149785ca1a870e8daee4d44847d2b5a904da48f3a95ef5e19bf45
7
+ data.tar.gz: 1f6e9a6ae468beb22d9a294c8c5a5d35cdb1517d40ce4f057b504a83dae5f6b77bb2aabb4fc69c40639324a3e76fe0022938b835b191a420304eceadd4470983
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Pete Hawkins
3
+ Copyright (c) 2017 Dawson Andrews Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Sequel::Rake::Migrations
1
+ # Sequel::Rake::Migrations
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sequel/rake/migrations`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- Or install it yourself as:
17
+ Require the tasks at the top of your Rakefile
20
18
 
21
- $ gem install sequel-rake-migrations
19
+ ```ruby
20
+ require "sequel/rake/migrations/tasks"
21
+ ```
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
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/[USERNAME]/sequel-rake-migrations.
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
 
@@ -1,7 +1,7 @@
1
1
  module Sequel
2
2
  module Rake
3
3
  module Migrations
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
data/lib/tasks/db.rake CHANGED
@@ -1,4 +1,5 @@
1
1
  require "fileutils"
2
+ require "dotenv"
2
3
 
3
4
  namespace :db do
4
5
  task :environment do
@@ -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.0
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