提交 87194b73 编写于 作者: D David Stosik

Test config.active_record.fk_ignore_pattern

上级 864e5008
......@@ -306,6 +306,14 @@ def test_schema_dumping_with_options
assert_match %r{\s+add_foreign_key "fk_test_has_fk", "fk_test_has_pk", column: "fk_id", primary_key: "pk_id", name: "fk_name"$}, output
end
def test_schema_dumping_with_custom_fk_ignore_pattern
ActiveRecord::Base.fk_ignore_pattern = /^ignored_/
@connection.add_foreign_key :astronauts, :rockets, name: :ignored_fk_astronauts_rockets
output = dump_table_schema "astronauts"
assert_match %r{\s+add_foreign_key "astronauts", "rockets"$}, output
end
def test_schema_dumping_on_delete_and_on_update_options
@connection.add_foreign_key :astronauts, :rockets, column: "rocket_id", on_delete: :nullify, on_update: :cascade
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册