Class | DataMapper::Migration |
In: |
lib/data_mapper/migration.rb
lib/data_mapper/migration.rb |
Parent: | Object |
# File lib/data_mapper/migration.rb, line 130 130: def add_column(table_name, column, type, options = {}) 131: table table_name do 132: add column, type, options 133: end 134: end
# File lib/data_mapper/migration.rb, line 130 130: def add_column(table_name, column, type, options = {}) 131: table table_name do 132: add column, type, options 133: end 134: end
# File lib/data_mapper/migration.rb, line 142 142: def change_column(table_name, column_name, type, options = {}) 143: table table_name do 144: alter column_name, type, options 145: end 146: end
# File lib/data_mapper/migration.rb, line 142 142: def change_column(table_name, column_name, type, options = {}) 143: table table_name do 144: alter column_name, type, options 145: end 146: end
Rails Style
# File lib/data_mapper/migration.rb, line 120 120: def create_table(table_name, options = {}, &block) 121: new_table = table.new(table_name, options) 122: yield new_table 123: new_table.after_create! 124: end
Rails Style
# File lib/data_mapper/migration.rb, line 120 120: def create_table(table_name, options = {}, &block) 121: new_table = table.new(table_name, options) 122: yield new_table 123: new_table.after_create! 124: end
# File lib/data_mapper/migration.rb, line 126 126: def drop_table(table_name) 127: table.drop(table_name) 128: end
# File lib/data_mapper/migration.rb, line 126 126: def drop_table(table_name) 127: table.drop(table_name) 128: end
# File lib/data_mapper/migration.rb, line 104 104: def migrate(direction = :up) 105: send(direction) 106: end
# File lib/data_mapper/migration.rb, line 104 104: def migrate(direction = :up) 105: send(direction) 106: end
# File lib/data_mapper/migration.rb, line 148 148: def remove_column(table_name, column) 149: table table_name do 150: remove column 151: end 152: end
# File lib/data_mapper/migration.rb, line 148 148: def remove_column(table_name, column) 149: table table_name do 150: remove column 151: end 152: end
# File lib/data_mapper/migration.rb, line 136 136: def rename_column(table_name, old_column_name, new_column_name) 137: table table_name do 138: rename old_column_name, new_column_name 139: end 140: end
# File lib/data_mapper/migration.rb, line 136 136: def rename_column(table_name, old_column_name, new_column_name) 137: table table_name do 138: rename old_column_name, new_column_name 139: end 140: end
# File lib/data_mapper/migration.rb, line 108 108: def table(table = nil, options = {}, &block) 109: if table && block 110: table = DataMapper::Migration::Table.new(table, options) 111: table.instance_eval &block 112: table.after_create! 113: else 114: return DataMapper::Migration::Table 115: end 116: end
# File lib/data_mapper/migration.rb, line 108 108: def table(table = nil, options = {}, &block) 109: if table && block 110: table = DataMapper::Migration::Table.new(table, options) 111: table.instance_eval &block 112: table.after_create! 113: else 114: return DataMapper::Migration::Table 115: end 116: end