Sha256: 959ebb77c5786881f17eec44edf534c6db62cac38de9e94d78270415cd00c026

Contents?: true

Size: 481 Bytes

Versions: 70

Compression:

Stored size: 481 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'

module DeclareSchema
  module SchemaChange
    class TableRename < Base
      def initialize(old_name, new_name)
        @old_name = old_name
        @new_name = new_name
      end

      def up_command
        "rename_table #{@old_name.to_sym.inspect}, #{@new_name.to_sym.inspect}"
      end

      def down_command
        "rename_table #{@new_name.to_sym.inspect}, #{@old_name.to_sym.inspect}"
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
declare_schema-2.3.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.3.0 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.3.0.pre.is.0 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.2.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.2.0.colin.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.2.0 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.1.0 lib/declare_schema/schema_change/table_rename.rb
declare_schema-2.1.0.pre.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.4.0 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.4.0.colin.11 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.6 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.6.colin.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.5 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.5.colin.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.4.0.colin.9 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.4 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.4.colin.1 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.4.0.colin.8 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.3 lib/declare_schema/schema_change/table_rename.rb
declare_schema-1.3.3.colin.1 lib/declare_schema/schema_change/table_rename.rb