Class: Rivulet::CLI::Commands::Generate::Migration
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Rivulet::CLI::Commands::Generate::Migration
- Defined in:
- lib/rivulet/cli/generate/migration.rb
Instance Method Summary collapse
Instance Method Details
#call(name:) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rivulet/cli/generate/migration.rb', line 11 def call(name:, **) FileUtils.mkdir_p('db/migrations') filename = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{underscore(name)}.sql" path = File.join('db/migrations', filename) File.write(path, "") puts " create #{path}" end |