# matthuhiggins/foreigner

Adds foreign key helpers to migrations and correctly dumps foreign keys to schema.rb

Repository: https://github.com/matthuhiggins/foreigner
Canonical: https://ross.abutalabs.com/products/foreigner
Language: Ruby
License: MIT
License Family: permissive
Last push: 2019-02-06T16:22:54+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 6348, "days_push": 2765, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1315, forks 122 (observed 2026-08-28T04:04:20.652482+00:00)

## What it is
A Ruby gem that adds foreign key helper methods to ActiveRecord migrations and dumps foreign keys into schema.rb. It was rendered obsolete by native foreign key support introduced in Rails 4.2.

## Use cases
- add foreign key constraints to rails migrations
- dump foreign keys to schema.rb
- manage foreign keys in rails 3 and earlier
- remove foreign key constraints in migrations

## When to choose
- maintaining a legacy Rails app on versions before 4.2 that needs foreign key support

## When to avoid
- using Rails 4.2 or later, which supports foreign keys natively
- starting a new project

## Facets
- artifact type: library
- maturity: abandoned
- function: database, orm
- domain: databases, web-development, developer-tools
- platform: ruby
- tags: foreign-keys, rails-migrations, activerecord, schema-dump, legacy, rails

## Member repositories
- matthuhiggins/foreigner (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:20.652482+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:48:41.956746+00:00, confidence not recorded.
  - readme: https://github.com/matthuhiggins/foreigner (fetched 2026-08-28T04:04:20.652482+00:00, sha d769fed7b0b1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
