Sha256: fdb1268e9afb1ed8fe1607290091a236f0f946d17b0388bfafd436e3bd394f2f
Contents?: true
Size: 938 Bytes
Versions: 22
Compression:
Stored size: 938 Bytes
Contents
require 'eucalypt/migration/namespaces/migration-create/generators/table' require 'eucalypt/app' require 'eucalypt/errors' require 'eucalypt/helpers' module Eucalypt class MigrationCreate < Thor include Eucalypt::Helpers using Colorize option :options, aliases: '-o', type: :hash, default: {}, enum: %w[primary_key id temporary force], desc: "Table options" desc "table [NAME] *[COLUMN∶TYPE]", "Creates a table".colorize(:grey) def table(name, *columns) directory = File.expand_path('.') if Eucalypt.app? directory validation = Eucalypt::Helpers::Migration::Validation.new columns return if validation.any_invalid? migration = Eucalypt::Generators::Create::Table.new migration.destination_root = directory migration.generate(name: name, columns: columns, options: options[:options]) else Eucalypt::Error.wrong_directory end end end end
Version data entries
22 entries across 22 versions & 1 rubygems