PHPackages                             pinkcrab/wp-db-migrations - 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. pinkcrab/wp-db-migrations

ActiveLibrary[Database &amp; ORM](/categories/database)

pinkcrab/wp-db-migrations
=========================

Creates wpdb migrations as part of the PinkCrab Plugin Framework

1.1.0(3w ago)37.0k↓71.4%11MITPHPPHP &gt;=8.0.0CI passing

Since Jan 28Pushed 1w agoCompare

[ Source](https://github.com/Pink-Crab/WPDB_Migrations)[ Packagist](https://packagist.org/packages/pinkcrab/wp-db-migrations)[ Docs](https://pinkcrab.co.uk)[ RSS](/packages/pinkcrab-wp-db-migrations/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (26)Versions (23)Used By (1)

WPDB\_Migrations
================

[](#wpdb_migrations)

System for creating database migrations with WordPress

[![Latest Stable Version](https://camo.githubusercontent.com/1a880a640f8575a47a06e718d626a96f5c2ff8a7224be16007007c43995a122e/68747470733a2f2f706f7365722e707567782e6f72672f70696e6b637261622f77702d64622d6d6967726174696f6e732f76)](https://packagist.org/packages/pinkcrab/wp-db-migrations) [![Total Downloads](https://camo.githubusercontent.com/93655682c70a91357f694c48ad2752478de8c55babaa65365d37e7fe7eae1aa1/68747470733a2f2f706f7365722e707567782e6f72672f70696e6b637261622f77702d64622d6d6967726174696f6e732f646f776e6c6f616473)](https://packagist.org/packages/pinkcrab/wp-db-migrations) [![Latest Unstable Version](https://camo.githubusercontent.com/17beacc227130d73e3e58bc579f42724f209e656ed52dce25369de9640a7e7a4/68747470733a2f2f706f7365722e707567782e6f72672f70696e6b637261622f77702d64622d6d6967726174696f6e732f762f756e737461626c65)](https://packagist.org/packages/pinkcrab/wp-db-migrations) [![License](https://camo.githubusercontent.com/a2a180443c639bb3326dc31ee75719a5ff0468458fc04939382b302007f1868e/68747470733a2f2f706f7365722e707567782e6f72672f70696e6b637261622f77702d64622d6d6967726174696f6e732f6c6963656e7365)](https://packagist.org/packages/pinkcrab/wp-db-migrations) [![PHP Version Require](https://camo.githubusercontent.com/c24c90a5c11bef70669fcbbb17d385cb796e2397f448daa77a972f9c1275195a/68747470733a2f2f706f7365722e707567782e6f72672f70696e6b637261622f77702d64622d6d6967726174696f6e732f726571756972652f706870)](https://packagist.org/packages/pinkcrab/wp-db-migrations)[![GitHub contributors](https://camo.githubusercontent.com/bd9ea2299fdabb6ba86dc8b29f4fb76a0f0a12f5c9517bc03eff97c0fd4d861e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f50696e6b2d437261622f575044425f4d6967726174696f6e733f6c6162656c3d436f6e7472696275746f7273)](https://camo.githubusercontent.com/bd9ea2299fdabb6ba86dc8b29f4fb76a0f0a12f5c9517bc03eff97c0fd4d861e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f50696e6b2d437261622f575044425f4d6967726174696f6e733f6c6162656c3d436f6e7472696275746f7273)[![GitHub issues](https://camo.githubusercontent.com/26cc919fed00eeb0371bbfb9b7efda6ad4108e4d82fc14a160d07f1f6bcc362b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f50696e6b2d437261622f575044425f4d6967726174696f6e73)](https://camo.githubusercontent.com/26cc919fed00eeb0371bbfb9b7efda6ad4108e4d82fc14a160d07f1f6bcc362b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f50696e6b2d437261622f575044425f4d6967726174696f6e73)[![WordPress 6.6 Test Suite [PHP8.0-8.4]](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_6.yaml/badge.svg)](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_6.yaml)[![WordPress 6.7 Test Suite [PHP8.0-8.4]](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_7.yaml/badge.svg)](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_7.yaml)[![WordPress 6.8 Test Suite [PHP8.0-8.4]](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_8.yaml/badge.svg)](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_8.yaml)[![WordPress 6.9 Test Suite [PHP8.0-8.4]](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_9.yaml/badge.svg)](https://github.com/Pink-Crab/WPDB_Migrations/actions/workflows/WP_6_9.yaml)[![codecov](https://camo.githubusercontent.com/7dd25ade1c7f6a89ddf1545ba0b0ea34d02a9b132b40edf74c34f0f4d1bc7b99/68747470733a2f2f636f6465636f762e696f2f67682f50696e6b2d437261622f575044425f4d6967726174696f6e732f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d57455a4f4c4f55524931)](https://codecov.io/gh/Pink-Crab/WPDB_Migrations)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d331b36993aa06eb13af57bb98e556db0a69b5c2cb9e4d388ad00ed5521fb5be/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50696e6b2d437261622f575044425f4d6967726174696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Pink-Crab/WPDB_Migrations/?branch=master)[![Maintainability](https://camo.githubusercontent.com/69c4cf5e71099733cb90672f5ef4869ee6c8d6b3474bc223b47c9b0b09f04897/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61363830333935363330363833666432663165342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Pink-Crab/WPDB_Migrations/maintainability)

---

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

[](#requirements)

Requires PinkCrab Table Builder, Composer and WordPress.

Uses the [WPDB Table Builder](https://github.com/Pink-Crab/WPDB-Table-Builder) library.

> **TESTED AGAINST**
>
> - PHP 8.0, 8.1, 8.2, 8.3 &amp; 8.4
> - MySQL 8.0, 8.4, 9 &amp; MariaDB 10.6, 10.11, 11.0, 11.2, 11.4, 11.8, 12
> - WP6.6, WP6.7, WP6.8 &amp; WP6.9

---

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

[](#installation)

```
$ composer require pinkcrab/wp-db-migrations
```

> If you are using this with the [PinkCrab Perique framework](https://perique.info), please use the [Perique Migrations](https://github.com/Pink-Crab/Perique_Migrations) module.

Why
---

[](#why)

Creates a wrapper around the WPDB\_Table\_Builder to make it easier to create Migrations for use with WP plugins or themes. Allows for the creation and dropping of database tables and the seeding of initial data.

How to use
----------

[](#how-to-use)

You will need to create your Migrations using the `Database_Migration` abstract class.

**[Read the Schema documentation](https://github.com/Pink-Crab/WPDB-Table-Builder/blob/master/docs/Schema.md)**

```
