Sha256: ee7dbbf72f9206ebbfb5cf8bc33e0a57f5c45eadd74b515058d9909f15450875
Contents?: true
Size: 790 Bytes
Versions: 15
Compression:
Stored size: 790 Bytes
Contents
require 'rails/generators' require 'rails/generators/migration' module OldSql class InstallMigrationsGenerator < Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) def self.next_migration_number(dirname) if ActiveRecord::Base.timestamped_migrations migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i migration_number += 1 migration_number.to_s else "%.3d" % (current_migration_number(dirname) + 1) end end def create_migration_file migration_template 'add_old_sql_admin_to_users_migration.rb', 'db/migrate/add_old_sql_admin_to_users.rb' rescue p $!.message #sleep 1 # ensure scripts have different timestamps end end end
Version data entries
15 entries across 15 versions & 1 rubygems