Type:
Class

Represents an SQL table in an abstract way for updating a table. Also see TableDefinition and ActiveRecord::ConnectionAdapters::SchemaStatements#create_table

Available transformations are:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
change_table :table do |t|
  t.column
  t.index
  t.rename_index
  t.timestamps
  t.change
  t.change_default
  t.rename
  t.references
  t.belongs_to
  t.string
  t.text
  t.integer
  t.float
  t.decimal
  t.datetime
  t.timestamp
  t.time
  t.date
  t.binary
  t.boolean
  t.remove
  t.remove_references
  t.remove_belongs_to
  t.remove_index
  t.remove_timestamps
end
remove
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

remove(*column_names) Instance Public methods Removes the column(s) from the

2025-01-10 15:47:30
change_default
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

change_default(column_name, default) Instance Public methods Sets a new default

2025-01-10 15:47:30
remove_belongs_to
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

remove_belongs_to(*args) Instance Public methods Alias for:

2025-01-10 15:47:30
index_exists?
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

index_exists?(column_name, options = {}) Instance Public methods Checks to see

2025-01-10 15:47:30
change
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

change(column_name, type, options = {}) Instance Public methods Changes the

2025-01-10 15:47:30
index
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

index(column_name, options = {}) Instance Public methods Adds a new index to

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

new(table_name, base) Class Public methods

2025-01-10 15:47:30
remove_references
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

remove_references(*args) Instance Public methods Removes a reference. Optionally

2025-01-10 15:47:30
column
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

column(column_name, type, options = {}) Instance Public methods Adds a new column

2025-01-10 15:47:30
remove_timestamps
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::Table

remove_timestamps() Instance Public methods Removes the timestamp columns (

2025-01-10 15:47:30