Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Fix code formatting and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Apr 7, 2012
1 parent bc34b60 commit 7cd5533
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/dm-migrations/adapters/dm-do-adapter.rb
Expand Up @@ -241,6 +241,7 @@ def property_schema_statement(connection, schema)

statement << " DEFAULT #{connection.quote_value(schema[:default])}" if schema.key?(:default)
statement << ' NOT NULL' unless schema[:allow_nil]

statement
end

Expand Down
8 changes: 4 additions & 4 deletions lib/dm-migrations/sql/mysql.rb
Expand Up @@ -45,7 +45,7 @@ def rename_column_type_statement(table_name, old_col, new_col)
column_info = select("SHOW COLUMNS FROM #{quote_name(table_name)} LIKE ?", old_col).first
column_options = {
:name => column_info.field,
:primitive => column_info.type
:primitive => column_info.type,
}

if column_info.null == 'YES'
Expand All @@ -61,10 +61,10 @@ def rename_column_type_statement(table_name, old_col, new_col)
end

column = with_connection do |connection|
property_schema_statement(connection,column_options)
end
property_schema_statement(connection, column_options)
end

column_name, column_definition = column.split(' ',2)
column_name, column_definition = column.split(' ', 2)

"ALTER TABLE #{quote_name(table_name)} CHANGE #{quote_name(old_col)} #{quote_name(new_col)} #{column_definition}"
end
Expand Down
5 changes: 2 additions & 3 deletions lib/dm-migrations/sql/sqlite.rb
Expand Up @@ -27,15 +27,14 @@ def supports_serial?
true
end

def change_column_type_statement(*args)
def change_column_type_statement(*)
raise NotImplementedError
end

def rename_column_type_statement(table_name, old_col, new_col)
def rename_column_type_statement(*)
raise NotImplementedError
end


class Table < SQL::Table
def initialize(adapter, table_name)
@columns = []
Expand Down
1 change: 0 additions & 1 deletion spec/integration/sql_spec.rb
Expand Up @@ -131,7 +131,6 @@
describe DataMapper::Migration, "#modify_table helper" do
before do
@migration = DataMapper::Migration.new(1, :create_people_table, :verbose => false) { }

end

it "should have a #modify_table helper" do
Expand Down

0 comments on commit 7cd5533

Please sign in to comment.