diff options
author | George Claghorn <george.claghorn@gmail.com> | 2018-08-12 16:17:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-12 16:17:40 -0400 |
commit | 15774d2581321565e02a75e740524cceddcf9167 (patch) | |
tree | ea12af4f1937fece624a2cbb4c4cb313828058eb | |
parent | 14d3c7c2c9b89fe76a3677f99d102dd6ca729927 (diff) | |
parent | e1817f80b4a43ffda93c152d7bc260447e0610d6 (diff) | |
download | rails-15774d2581321565e02a75e740524cceddcf9167.tar.gz rails-15774d2581321565e02a75e740524cceddcf9167.tar.bz2 rails-15774d2581321565e02a75e740524cceddcf9167.zip |
Merge pull request #33590 from bogdanvlviv/follow-up-33563-33474
Update "Active Record Migrations" guide [ci skip]
-rw-r--r-- | guides/source/active_record_migrations.md | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index e2359a35f1..4d195988f8 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -491,9 +491,8 @@ NOTE: Active Record only supports single column foreign keys. `execute` and `structure.sql` are required to use composite foreign keys. See [Schema Dumping and You](#schema-dumping-and-you). -NOTE: At this time, only the mysql, mysql2 and postgresql adapters support -foreign keys. Implementation for sqlite3 is partial, keys are created for new -tables but not for existing tables via `ALTER TABLE` statement. +NOTE: The SQLite3 adapter doesn't support `add_foreign_key` since SQLite supports +only [a limited subset of ALTER TABLE](https://www.sqlite.org/lang_altertable.html). Removing a foreign key is easy as well: @@ -1051,17 +1050,17 @@ application. Old Migrations -------------- -The `schema.rb` or `structure.sql` is a snapshot of the current state of your +The `db/schema.rb` or `db/structure.sql` is a snapshot of the current state of your database and is the authoritative source for rebuilding that database. This makes it possible to delete old migration files. When you delete migration files in the `db/migrate/` directory, any environment -where `db:migrate` was run when those files still existed will hold a reference +where `rails db:migrate` was run when those files still existed will hold a reference to the migration timestamp specific to them inside an internal Rails database table named `schema_migrations`. This table is used to keep track of whether migrations have been executed in a specific environment. -If you run the `db:migrate:status` command, which displays the status +If you run the `rails db:migrate:status` command, which displays the status (up or down) of each migration, you should see `********** NO FILE **********` displayed next to any deleted migration file which was once executed on a -specific environment but can no longer be found in the `db/migrate` directory. +specific environment but can no longer be found in the `db/migrate/` directory. |