v5.1.7 -
Show latest stable
-
0 notes
- Superclass:
ActiveRecord::Migration
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (-34)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (21)
- 3.0.9 (-38)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-7)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (1)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (4)
- 7.1.3.4 (0)
- 7.2.3 (0)
- 8.0.0 (0)
- 8.1.1 (0)
- What's this?
Active Record Schema
Allows programmers to programmatically define a schema in a portable DSL. This means you can define tables, indexes, etc. without using SQL directly, so your applications can more easily support multiple databases.
Usage:
ActiveRecord::Schema.define do create_table :authors do |t| t.string :name, null: false end add_index :authors, :name, :unique create_table :posts do |t| t.integer :author_id, null: false t.string :subject t.text :body t.boolean :private, default: false end add_index :posts, :author_id end
ActiveRecord::Schema is only supported by database adapters that also support migrations, the two features being very similar.

