Prefer to place a table options before force: :cascade#28005
Prefer to place a table options before force: :cascade#28005kamipo merged 1 commit intorails:masterfrom
force: :cascade#28005Conversation
f513e93 to
b8b6502
Compare
b8b6502 to
22e118b
Compare
22e118b to
92bfe11
Compare
I was added a table options after `force: :cascade` in rails#17569 for not touching existing tests (reducing diff). But `force: :cascade` is not an important information. So I prefer to place a table options before `force: :cascade`.
92bfe11 to
edd652e
Compare
force: :cascadeforce: :cascade
|
I'm working on implementing this pull request into Oracle enhanced adapter. The implementation itself is easy but I'm having some difficulty to find failing test cases. Created a https://github.com/yahonda/rails/tree/diag28005 branch which just reverts $ for i in sqlite3 mysql2 postgresql; do echo $i; ARCONN=$i bin/test test/cases/comment_test.rb:104 -v; done
sqlite3
Using sqlite3
Run options: -v --seed 36838
# Running:
Finished in 0.001261s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
mysql2
Using mysql2
Run options: -v --seed 33639
# Running:
CommentTest#test_schema_dump_with_comments = 0.44 s = .
Finished in 0.452178s, 2.2115 runs/s, 30.9613 assertions/s.
1 runs, 14 assertions, 0 failures, 0 errors, 0 skips
postgresql
Using postgresql
Run options: -v --seed 20944
# Running:
CommentTest#test_schema_dump_with_comments = 0.45 s = .
Finished in 0.461127s, 2.1686 runs/s, 30.3604 assertions/s.
1 runs, 14 assertions, 0 failures, 0 errors, 0 skips$ for i in sqlite3 mysql2 postgresql; do echo $i; ARCONN=$i bin/test test/cases/schema_dumper_test.rb:67 -v; done
sqlite3
Using sqlite3
Run options: -v --seed 15255
# Running:
SchemaDumperTest#test_schema_dump_uses_force_cascade_on_create_table = 0.19 s = .
Finished in 0.219432s, 4.5572 runs/s, 9.1144 assertions/s.
1 runs, 2 assertions, 0 failures, 0 errors, 0 skips
mysql2
Using mysql2
Run options: -v --seed 40232
# Running:
SchemaDumperTest#test_schema_dump_uses_force_cascade_on_create_table = 0.33 s = .
Finished in 0.352691s, 2.8353 runs/s, 5.6707 assertions/s.
1 runs, 2 assertions, 0 failures, 0 errors, 0 skips
postgresql
Using postgresql
Run options: -v --seed 25193
# Running:
SchemaDumperTest#test_schema_dump_uses_force_cascade_on_create_table = 0.34 s = .
Finished in 0.359240s, 2.7837 runs/s, 5.5673 assertions/s.
1 runs, 2 assertions, 0 failures, 0 errors, 0 skips
$Would you give me some advice how to change these tests fail if |
|
This change is only affected to adapters that is supported dumping table options ( For failing --- a/activerecord/test/cases/comment_test.rb
+++ b/activerecord/test/cases/comment_test.rb
@@ -111,7 +111,7 @@ def test_schema_dump_with_comments
# And check that these changes are reflected in dump
output = dump_table_schema "commenteds"
- assert_match %r[create_table "commenteds",.*\s+comment: "A table with comment"], output
+ assert_match %r[create_table "commenteds",.*\s+comment: "A table with comment", force: :cascade do |t|$], output
assert_match %r[t\.string\s+"name",\s+comment: "Comment should help clarify the column purpose"], output
assert_match %r[t\.string\s+"obvious"\n], output
assert_match %r[t\.string\s+"content",\s+comment: "Whoa, content describes itself!"], outputFor failing --- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -66,7 +66,7 @@ def test_schema_dump
def test_schema_dump_uses_force_cascade_on_create_table
output = dump_table_schema "authors"
- assert_match %r{create_table "authors",.* force: :cascade}, output
+ assert_match %r{create_table "authors",.* force: :cascade do |t|$}, output
end
def test_schema_dump_excludes_sqlite_sequence |
|
Thanks for the update. I got to know it depends each database adapter implements Thanks again for commenting the closed pull requests. |
Oracle enhanced adapter implements table comments options Refer rails/rails#28005 and rsim#1439
I was added a table options after
force: :cascadein #17569 for nottouching existing tests (reducing diff). But
force: :cascadeis not animportant information. So I prefer to place a table options before
force: :cascade.