banana 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/lib/banana/tasks/database.rake +14 -3
- data/lib/banana/version.rb +1 -1
- metadata +3 -3
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
tasks = Rake.application.instance_variable_get '@tasks'
|
2
|
-
|
3
|
-
|
4
|
-
tasks.delete
|
2
|
+
override_tasks = ['db:create', 'db:drop', 'db:migrate', 'db:schema:dump']
|
3
|
+
unsupported_tasks = ['db:schema:load']
|
4
|
+
(override_tasks + unsupported_tasks).each { |task_name| tasks.delete(task_name) }
|
5
5
|
|
6
6
|
db_namespace = namespace :db do
|
7
7
|
desc 'Create the multiple databases from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)'
|
@@ -9,6 +9,17 @@ db_namespace = namespace :db do
|
|
9
9
|
configs_for_multi_environment.each { |config| create_database(config) }
|
10
10
|
end
|
11
11
|
|
12
|
+
desc "Migrate the database (options: VERSION=x, VERBOSE=false)."
|
13
|
+
task :migrate => [:environment, :load_config] do
|
14
|
+
ActiveRecord::Base.establish_connection(Rails.env)
|
15
|
+
|
16
|
+
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
|
17
|
+
ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
|
18
|
+
ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
|
19
|
+
end
|
20
|
+
db_namespace['_dump'].invoke
|
21
|
+
end
|
22
|
+
|
12
23
|
desc 'Drops the multiple databases for the current Rails.env (use db:drop:all to drop all databases)'
|
13
24
|
task :drop => :load_config do
|
14
25
|
configs_for_multi_environment.each { |config| drop_database_and_rescue(config) }
|
data/lib/banana/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -43,7 +43,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
43
|
version: '0'
|
44
44
|
segments:
|
45
45
|
- 0
|
46
|
-
hash:
|
46
|
+
hash: 109049043091770607
|
47
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
48
|
none: false
|
49
49
|
requirements:
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
version: '0'
|
53
53
|
segments:
|
54
54
|
- 0
|
55
|
-
hash:
|
55
|
+
hash: 109049043091770607
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
58
|
rubygems_version: 1.8.24
|