class AlterTable
Definitions
def add_column(name, type, **options)
Add a new column to the table
Implementation
def add_column(name, type, **options)
@operations << [:add_column, name, type, options]
end
def drop_column(name, if_exists: false)
Drop a column from the table
Implementation
def drop_column(name, if_exists: false)
@operations << [:drop_column, name, {if_exists: if_exists}]
end
def rename_column(old_name, new_name)
Rename a column
Implementation
def rename_column(old_name, new_name)
@operations << [:rename_column, old_name, new_name, {}]
end
def change_column(name, type, **options)
Change column type or options
Implementation
def change_column(name, type, **options)
@operations << [:change_column, name, type, options]
end