PHPackages                             craftcms/fix-fks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. craftcms/fix-fks

ActiveCraft-plugin[Database &amp; ORM](/categories/database)

craftcms/fix-fks
================

Restore missing foreign key constraints in the database.

2.1.0(2y ago)1217.5k2[1 PRs](https://github.com/craftcms/fix-fks/pulls)MITPHPCI passing

Since Feb 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/craftcms/fix-fks)[ Packagist](https://packagist.org/packages/craftcms/fix-fks)[ RSS](/packages/craftcms-fix-fks/feed)WikiDiscussions 2.x Synced today

READMEChangelog (1)Dependencies (4)Versions (9)Used By (0)

Fix FKs utility for Craft CMS
=============================

[](#fix-fks-utility-for-craft-cms)

This plugin enables users to restore foreign key constraints in their database.

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.0.0+ or 5.0.0+.

Installation
------------

[](#installation)

You can install this plugin from the Plugin Store or with Composer.

#### From the Plugin Store

[](#from-the-plugin-store)

Go to the Plugin Store in your project’s Control Panel and search for “Fix FKs”. Then click on the “Install” button in its modal window.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/fix-fks

# tell Craft to install the plugin
./craft plugin/install fix-fks
```

Usage
-----

[](#usage)

Run the restore operation by navigating to Utilities → Fix FKs in the Control Panel.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 71.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~316 days

Recently: every ~499 days

Total

8

Last Release

837d ago

Major Versions

v1.x-dev → 2.0.02022-05-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ccdf8b493035de2343c55bd889513e3af5c04d5823482a2b186ad16adb1c3e3?d=identicon)[brandonkelly](/maintainers/brandonkelly)

---

Top Contributors

[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (27 commits)")[![angrybrad](https://avatars.githubusercontent.com/u/61869?v=4)](https://github.com/angrybrad "angrybrad (7 commits)")[![i-just](https://avatars.githubusercontent.com/u/4500340?v=4)](https://github.com/i-just "i-just (1 commits)")[![michtio](https://avatars.githubusercontent.com/u/5818021?v=4)](https://github.com/michtio "michtio (1 commits)")[![sergeifilippov](https://avatars.githubusercontent.com/u/123676?v=4)](https://github.com/sergeifilippov "sergeifilippov (1 commits)")[![XhmikosR](https://avatars.githubusercontent.com/u/349621?v=4)](https://github.com/XhmikosR "XhmikosR (1 commits)")

---

Tags

craft-plugincraftcmsdatabasedbcmsyii2craftcms

### Embed Badge

![Health badge](/badges/craftcms-fix-fks/health.svg)

```
[![Health](https://phpackages.com/badges/craftcms-fix-fks/health.svg)](https://phpackages.com/packages/craftcms-fix-fks)
```

###  Alternatives

[craftcms/commerce

Craft Commerce

240425.9k186](/packages/craftcms-commerce)[craftcms/query

Execute database queries from the Control Panel

1614.5k1](/packages/craftcms-query)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[craftcms/ckeditor

Edit rich text content in Craft CMS using CKEditor.

47406.9k77](/packages/craftcms-ckeditor)[dmstr/yii2-db

Database extensions

19656.2k6](/packages/dmstr-yii2-db)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
