<commit_before>[![Gem Version](https://badge.fury.io/rb/schema_auto_foreign_keys.svg)](http://badge.fury.io/rb/schema_auto_foreign_keys)
[![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_auto_foreign_keys.svg)](http://travis-ci.org/SchemaPlus/schema_auto_foreign_keys)
[![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_auto_foreign_keys.svg)](https://coveralls.io/r/SchemaPlus/schema_auto_foreign_keys)
[![Dependency Status](https://gemnasium.com/lomba/schema_auto_foreign_keys.svg)](https://gemnasium.com/SchemaPlus/schema_auto_foreign_keys)

# SchemaAutoForeignKeys


SchemaAutoForeignKeys is part of the [SchemaPlus](https://github.com/SchemaPlus/) family of Ruby on Rails ActiveRecord extension gems.

## Usage

Many of us think that it should goes without saying that if you define a foreign key *relation* in your database you should also define a foreign key *constraint*.

Similarly, it should go without saying that if you have a foreign key *constraint* on a column, you should also have an *index* on that column.

And if you include the `schema_auto_foreign_keys` gem, these will also go without typing!  schema_auto_foreign_keys simply turns on some default behavior in your migrations:

```ruby
t.integer :user_id  # any column named xxxx_id defaults to...<commit_msg>remove broken badge<commit_after>[![Gem Version](https://badge.fury.io/rb/schema_auto_foreign_keys.svg)](http://badge.fury.io/rb/schema_auto_foreign_keys)
[![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_auto_foreign_keys.svg)](http://travis-ci.org/SchemaPlus/schema_auto_foreign_keys)
[![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_auto_foreign_keys.svg)](https://coveralls.io/r/SchemaPlus/schema_auto_foreign_keys)

# SchemaAutoForeignKeys


SchemaAutoForeignKeys is part of the [SchemaPlus](https://github.com/SchemaPlus/) family of Ruby on Rails ActiveRecord extension gems.

## Usage

Many of us think that it should goes without saying that if you define a foreign key *relation* in your database you should also define a foreign key *constraint*.

Similarly, it should go without saying that if you have a foreign key *constraint* on a column, you should also have an *index* on that column.

And if you include the `schema_auto_foreign_keys` gem, these will also go without typing!  schema_auto_foreign_keys simply turns on some default behavior in your migrations:

```ruby
t.integer :user_id  # any column named xxxx_id defaults to...
{'fraction_non_alphanumeric': 0.1024, 'fraction_numerical': 0.0, 'mean_word_length': 5.8708791208791204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3416897', 'n_tokens_mistral': 772, 'n_tokens_neox': 733, 'n_words': 221}