Sha256: 7e3270c3a368ba3f4b5fef88b02643d74da893bc868400d89e7e01d9d09d5b87
Contents?: true
Size: 847 Bytes
Versions: 73
Compression:
Stored size: 847 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 sleep 1 # ensure scripts have different timestamps 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
73 entries across 73 versions & 1 rubygems