Sha256: a20011262d36c12fc494fa5b17d301de234796dfd863df9032abfb0f2f427daa

Contents?: true

Size: 897 Bytes

Versions: 23

Compression:

Stored size: 897 Bytes

Contents

module Myreplicator
  class VerticaTypes
  
    def self.convert type, col_type
      if mysql_vertica_conversion[type].blank?
        return col_type
      else
        return mysql_vertica_conversion[type]
      end
    end

    def self.mysql_vertica_conversion
      map = {
        "int" => "int",
        "integer" => "int",
        "int8" => "int",
        "smallint" => "int",
        "bigint" => "int",
        "tinyint" => "int",
        "numeric" => "int",
        "text" => "VARCHAR(65000)",
        "mediumtext" => "VARCHAR(65000)",
        "bit" => "binary",
        "longtext" => "VARCHAR(65000)",
        "float" => "decimal"
      }
    end

    def self.convert_key key
      map = {
        "UNI" => "UNIQUE",
      " MUL" => "", 
        "PRI" => "PRIMARY KEY"
      }

      if map[key].blank?
        return ""
      else
        return map[key]
      end
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
myreplicator-1.1.24 lib/loader/vertica/types.rb
myreplicator-1.1.23 lib/loader/vertica/types.rb
myreplicator-1.1.22 lib/loader/vertica/types.rb
myreplicator-1.1.21 lib/loader/vertica/types.rb
myreplicator-1.1.20 lib/loader/vertica/types.rb
myreplicator-1.1.19 lib/loader/vertica/types.rb
myreplicator-1.1.18 lib/loader/vertica/types.rb
myreplicator-1.1.17 lib/loader/vertica/types.rb
myreplicator-1.1.16 lib/loader/vertica/types.rb
myreplicator-1.1.15 lib/loader/vertica/types.rb
myreplicator-1.1.13 lib/loader/vertica/types.rb
myreplicator-1.1.12 lib/loader/vertica/types.rb
myreplicator-1.1.11 lib/loader/vertica/types.rb
myreplicator-1.1.10 lib/loader/vertica/types.rb
myreplicator-1.1.9 lib/loader/vertica/types.rb
myreplicator-1.1.7 lib/loader/vertica/types.rb
myreplicator-1.1.6 lib/loader/vertica/types.rb
myreplicator-1.1.5 lib/loader/vertica/types.rb
myreplicator-1.1.4 lib/loader/vertica/types.rb
myreplicator-1.1.3 lib/loader/vertica/types.rb