Sha256: 2619199c86b051ce72410dfa5e4c69c30f7d308eb52856dc4d8b899d427bdc39

Contents?: true

Size: 1.73 KB

Versions: 7

Compression:

Stored size: 1.73 KB

Contents

require 'eucalypt/eucalypt-migration/namespaces/migration-create/cli/create'
require 'eucalypt/eucalypt-migration/namespaces/migration-add/cli/add'
require 'eucalypt/eucalypt-migration/namespaces/migration-drop/cli/drop'
require 'eucalypt/eucalypt-migration/namespaces/migration-rename/cli/rename'
require 'eucalypt/eucalypt-migration/namespaces/migration-change/cli/change'
require 'eucalypt/eucalypt-migration/namespaces/migration-blank/cli/blank'
require 'eucalypt/helpers'

module Eucalypt
  class Migration < Thor
    include Thor::Actions
    include Eucalypt::Helpers
    using Colorize

    desc "types", "Display permitted column types".colorize(:grey)
    def types
      puts Eucalypt::Helpers::Migration::Validation::COLUMN_TYPES.inspect
    end

    class << self
      require 'eucalypt/list'
      include Eucalypt::List
      def banner(task, namespace = false, subcommand = true)
        basename + ' ' + task.formatted_usage(self, true, subcommand).split(':').join(' ')
      end
    end

    register(Eucalypt::MigrationCreate, 'create', 'create [COMMAND]', 'Create tables'.colorize(:grey))
    register(Eucalypt::MigrationAdd, 'add', 'add [COMMAND]', 'Add indexes and columns to a table'.colorize(:grey))
    register(Eucalypt::MigrationDrop, 'drop', 'drop [COMMAND]', 'Drop tables, columns and indexes'.colorize(:grey))
    register(Eucalypt::MigrationRename, 'rename', 'rename [COMMAND]', 'Rename tables, columns and indexes'.colorize(:grey))
    register(Eucalypt::MigrationChange, 'change', 'change [COMMAND]', 'Change column definitions'.colorize(:grey))
  end
  class CLI < Thor
    include Eucalypt::Helpers
    using Colorize
    register(Migration, 'migration', 'migration [COMMAND]', 'Generate ActiveRecord migrations'.colorize(:grey))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eucalypt-0.2.2 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.2.1 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.2.0 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.1.3 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.1.2 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.1.1 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb
eucalypt-0.1.0 lib/eucalypt/eucalypt-migration/namespaces/migration/cli/migration.rb