Module: Hippo::Command::MigrationSupport

Included in:
GenerateMigration, GenerateModel
Defined in:
lib/hippo/command/migration_support.rb

Instance Method Summary collapse

Instance Method Details

#create_migrationObject


6
7
8
9
10
11
# File 'lib/hippo/command/migration_support.rb', line 6

def create_migration
    migration = existing_migration ||
      migration_timestamp + "_create_#{table_name}.rb"
    self.fields = fields.map{ |field| ModelAttribute.parse(field) }
    template "db/create_table_migration.rb", "db/migrate/#{migration}"
end