This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :generate do | |
desc 'Generate a timestamped, empty Sequel migration.' | |
task :migration, :name do |_, args| | |
if args[:name].nil? | |
puts 'You must specify a migration name (e.g. rake generate:migration[create_contacts])!' | |
exit false | |
end | |
content = "Sequel.migration do\n up do\n \n end\n\n down do\n \n end\nend\n" | |
seq_next = get_next_seq |