From 36ce0c2c821e2c9cca15e768842461f834825bf7 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 16 Dec 2014 09:58:34 +0100 Subject: `db:structure:load` and `db:schema:load` no longer purge the database. Closes #17945 `db:test:prepare` still purges the database to always keep the test database in a consistent state. This patch introduces new problems with `db:schema:load`. Prior to the introduction of foreign-keys, we could run this file against a non-empty database. Since every `create_table` containted the `force: true` option, this would recreate tables when loading the schema. However with foreign-keys in place, `force: true` wont work anymore and the task will crash. /cc @schneems --- activerecord/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 72b770e2d5..28441e598e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,11 @@ +* `db:schema:load` and `db:structure:load` no longer purge the database + before loading the schema. This is left for the user to do. + `db:test:prepare` will still purge the database. + + Closes #17945. + + *Yves Senn* + * Fix undesirable RangeError by Type::Integer. Add Type::UnsignedInteger. *Ryuta Kamizono* -- cgit v1.2.3 From be1e0241f012f1151d2448b10e14b8b2eda26b84 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 18 Dec 2014 10:07:23 +0100 Subject: `force: :cascade` to recreate tables referenced by foreign-keys. --- activerecord/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 28441e598e..6494c7374e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* Introduce `force: :cascade` option for `create_table`. Using this option + will recreate tables even if they have dependent objects (like foreign keys). + `db/schema.rb` now uses `force: :cascade`. This makes it possible to + reload the schema when foreign keys are in place. + + *Matthew Draper*, *Yves Senn* + * `db:schema:load` and `db:structure:load` no longer purge the database before loading the schema. This is left for the user to do. `db:test:prepare` will still purge the database. -- cgit v1.2.3