192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
# File 'lib/ardb/cli/commands.rb', line 192
def run(argv, *args)
super
Ardb.init(false)
begin
require 'ardb/migration'
migration = Ardb::Migration.new(Ardb.config, @clirb.args.first)
migration.save!
@stdout.puts "generated #{migration.file_path}"
rescue Ardb::Migration::NoIdentifierError => exception
error = ArgumentError.new("MIGRATION-NAME must be provided")
error.set_backtrace(exception.backtrace)
raise error
rescue StandardError => e
@stderr.puts e
@stderr.puts e.backtrace.join("\n")
@stderr.puts "error generating migration"
raise CommandExitError
end
end
|