Module: DataMapper::Adapters::Sqlite3Adapter::Migration
- Defined in:
- lib/dm-mapping/adapters/sqlite3adapter.rb
Instance Method Summary collapse
Instance Method Details
#fields(table) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dm-mapping/adapters/sqlite3adapter.rb', line 21 def fields table query_table(table).map{ |field| type, chain = self.class.type_map. lookup_primitive(field.type.gsub(/\(\d+\)/, '').upcase) # stupid hack type = String if type == Class attrs = {} attrs[:serial] = true if field.pk != 0 attrs[:nullable] = true if field.notnull != 0 && !attrs[:serial] attrs[:default] = field.dflt_value[1..-2] if field.dflt_value [field.name, type, attrs.merge(chain.attributes)] } end |
#storages ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dm-mapping/adapters/sqlite3adapter.rb', line 9 def storages # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 177 sql = <<-SQL SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' SQL # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 181 query sql end |