Module: Sequel::SchemaDumper

Included in:
Redshift::SchemaDumper
Defined in:
lib/sequel/extensions/schema_dumper_ext.rb

Instance Method Summary collapse

Instance Method Details

#column_schema_to_ruby_type(schema) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 16

def column_schema_to_ruby_type(schema)
  case schema[:db_type].downcase
  when 'uuid'
    { type: :uuid }
  when /char(?:acter)?\(36\)/
    { type: Suuid }
  else
    column_schema_to_ruby_type_without_uuid(schema)
  end
end

#column_schema_to_ruby_type_without_uuidObject



6
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 6

alias_method :column_schema_to_ruby_type_without_uuid, :column_schema_to_ruby_type

#dump_schema_migration(options = OPTS) ⇒ Object



12
13
14
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 12

def dump_schema_migration(options=OPTS)
  dump_schema_migration_original(options).to_s.gsub(/^\s+$/, '')
end

#dump_schema_migration_originalObject



5
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 5

alias_method :dump_schema_migration_original, :dump_schema_migration

#dump_table_schema(table, opts = OPTS) ⇒ Object



8
9
10
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 8

def dump_table_schema(table, opts=OPTS)
  dump_table_schema_without_force(table, opts).gsub('create_table(', 'create_table!(')
end

#dump_table_schema_without_forceObject



4
# File 'lib/sequel/extensions/schema_dumper_ext.rb', line 4

alias_method :dump_table_schema_without_force, :dump_table_schema