Sha256: d471951eaf963b2b49e37902d49c4629dd040e0ddb93b54116b34a7528aa1bf1
Contents?: true
Size: 927 Bytes
Versions: 7
Compression:
Stored size: 927 Bytes
Contents
require 'eucalypt/eucalypt-migration/namespaces/migration-add/generators/column' require 'eucalypt/app' require 'eucalypt/errors' require 'eucalypt/helpers' module Eucalypt class MigrationAdd < Thor include Eucalypt::Helpers using Colorize option :options, aliases: '-o', type: :hash, default: {}, enum: %w[limit default null precision scale], desc: "Column options" desc "column [TABLE] [COLUMN] [TYPE]", "Adds a column".colorize(:grey) def column(table, column, type) directory = File.expand_path('.') if Eucalypt.app? directory return unless Eucalypt::Helpers::Migration::Validation.valid_type? type migration = Eucalypt::Generators::Add::Column.new migration.destination_root = directory migration.generate(table: table, column: column, type: type, options: options[:options]) else Eucalypt::Error.wrong_directory end end end end
Version data entries
7 entries across 7 versions & 1 rubygems