Skip to content

Instantly share code, notes, and snippets.

Avatar

Raymond Hughes Ray-Hughes

View GitHub Profile
@Ray-Hughes
Ray-Hughes / cp_generate_migration.rake
Last active Jul 28, 2017
Sequel generate migration
View cp_generate_migration.rake
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