Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Re-add support for using 'strings' for more control over the types

  • Loading branch information...
commit 2784f4065da633ebabd5bff953e716027242cd26 1 parent 1810b57
Paul Sadauskas authored
8 dm-migrations/lib/sql/table_creator.rb
View
@@ -38,12 +38,16 @@ def build_type(type_class)
schema = {:name => @name, :quote_column_name => quoted_name}.merge(@opts)
schema[:serial?] ||= schema[:serial]
schema[:nullable?] ||= schema[:nullable]
- schema = @adapter.class.type_map[type_class].merge(schema)
+ if type_class.is_a?(String)
+ schema[:type] = type_class
+ else
+ schema = @adapter.class.type_map[type_class].merge(schema)
+ end
@adapter.property_schema_statement(schema)
end
def to_sql
- type
+ type
end
def quoted_name
4 dm-migrations/spec/integration/sql_spec.rb
View
@@ -3,12 +3,12 @@
[:sqlite3, :mysql, :postgres].each do |adapter|
next unless eval("HAS_#{adapter.to_s.upcase}")
- describe "Using Adapter #{adapter}, " do
+ describe "Using Adapter #{adapter}," do
describe DataMapper::Migration, "#create_table helper" do
before do
@creator = DataMapper::Migration::TableCreator.new(repository(adapter).adapter, :people) do
column :id, Integer, :serial => true
- column :name, String
+ column :name, 'varchar(50)'
column :long_string, String, :size => 200
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.