Sha256: 76e9a997a3fdbab20007b50023f5a21c9c1c7ed0c5d754981e989b249a0ebd5c

Contents?: true

Size: 687 Bytes

Versions: 7

Compression:

Stored size: 687 Bytes

Contents

require 'eucalypt/eucalypt-migration/namespaces/migration-rename/generators/index'
require 'eucalypt/helpers'
require 'eucalypt/errors'

module Eucalypt
  class MigrationRename < Thor
    include Eucalypt::Helpers
    using Colorize

    desc "index [TABLE] [OLD] [NEW]", "Renames an index".colorize(:grey)
    def index(table, old_name, new_name)
      directory = File.expand_path('.')
      if Eucalypt.app? directory
        migration = Eucalypt::Generators::Rename::Index.new
        migration.destination_root = directory
        migration.generate(table: table, old_name: old_name, new_name: new_name)
      else
        Eucalypt::Error.wrong_directory
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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