edge badge
Methods
C
D
I
T
V
Instance Public methods
create_table(limit=nil)
# File activerecord/lib/active_record/schema_migration.rb, line 21
def create_table(limit=nil)
  unless table_exists?
    version_options = {null: false}
    version_options[:limit] = limit if limit

    connection.create_table(table_name, id: false) do |t|
      t.column :version, :string, version_options
    end
    connection.add_index table_name, :version, unique: true, name: index_name
  end
end
drop_table()
# File activerecord/lib/active_record/schema_migration.rb, line 33
def drop_table
  if table_exists?
    connection.remove_index table_name, name: index_name
    connection.drop_table(table_name)
  end
end
index_name()
# File activerecord/lib/active_record/schema_migration.rb, line 13
def index_name
  "#{table_name_prefix}unique_#{ActiveRecord::Base.schema_migrations_table_name}#{table_name_suffix}"
end
table_exists?()
# File activerecord/lib/active_record/schema_migration.rb, line 17
def table_exists?
  connection.table_exists?(table_name)
end
table_name()
# File activerecord/lib/active_record/schema_migration.rb, line 9
def table_name
  "#{table_name_prefix}#{ActiveRecord::Base.schema_migrations_table_name}#{table_name_suffix}"
end
version()
# File activerecord/lib/active_record/schema_migration.rb, line 41
def version
  super.to_i
end