bin/schema in ricardochimal-taps-0.2.13 vs bin/schema in ricardochimal-taps-0.2.14
- old
+ new
@@ -8,10 +8,11 @@
cmd = ARGV.shift.strip rescue ''
database_url = ARGV.shift.strip rescue ''
def show_usage_and_exit
puts <<EOTXT
+ schema console <database_url>
schema dump <database_url>
schema indexes <database_url>
schema reset_db_sequences <database_url>
schema load <database_url> <schema_file>
schema load_indexes <database_url> <indexes_file>
@@ -31,8 +32,14 @@
filename = ARGV.shift.strip rescue ''
schema = File.read(filename) rescue show_usage_and_exit
Taps::Schema.load(database_url, schema)
elsif cmd == 'reset_db_sequences'
Taps::Schema.reset_db_sequences(database_url)
+elsif cmd == 'console'
+ Taps::Schema.connection(database_url)
+ $db = ActiveRecord::Base.connection
+ require 'irb'
+ require 'irb/completion'
+ IRB.start
else
show_usage_and_exit
end