Sha256: 778c4905da9a0b869e08fc3981d928ed3d195ad9e42a6c50af3150ed9097f56c

Contents?: true

Size: 617 Bytes

Versions: 20

Compression:

Stored size: 617 Bytes

Contents

module Torque
  module PostgreSQL
    module Adapter
      module ColumnDumper

        # Adds +:subtype+ as a valid migration key
        def migration_keys
          super + [:subtype]
        end

        # Adds +:subtype+ option to the default set
        def prepare_column_options(column)
          spec = super

          if subtype = schema_subtype(column)
            spec[:subtype] = subtype
          end

          spec
        end

        private

          def schema_subtype(column)
            column.sql_type.to_sym.inspect if [:enum].include? column.type
          end

      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
torque-postgresql-0.2.12 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.11 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.10 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.9 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.8 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.7 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.6 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.5 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.4 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.3 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.2 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.2.1 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.7 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.6 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.5 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.4 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.3 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.2 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.1 lib/torque/postgresql/adapter/schema_dumper.rb
torque-postgresql-0.1.0 lib/torque/postgresql/adapter/schema_dumper.rb