PHPackages                             fishingboy/codeigniter-migration - 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. fishingboy/codeigniter-migration

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

fishingboy/codeigniter-migration
================================

Codeigniter Migration

1.0.4(5y ago)4605↓71.4%1MITPHP

Since Aug 25Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/fishingboy/Codeigniter-Migration)[ Packagist](https://packagist.org/packages/fishingboy/codeigniter-migration)[ RSS](/packages/fishingboy-codeigniter-migration/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

CodeIgniter Migration CLI
=========================

[](#codeigniter-migration-cli)

[![Packagist Version](https://camo.githubusercontent.com/fc676ceed7e945feecf27d90408801c347667a1d9004856173aa23113bb35a30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66697368696e67626f792f636f646569676e697465722d6d6967726174696f6e2e737667)](https://packagist.org/packages/fishingboy/codeigniter-migration)[![Downloads](https://camo.githubusercontent.com/501710c1922cc217e3df5b84554642f762d0be5748327c10aa3b04afa162545a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66697368696e67626f792f636f646569676e697465722d6d6967726174696f6e2e7376673f6c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/fishingboy/codeigniter-migration)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

A small Composer package that adds practical command-line migration commands to CodeIgniter 3 projects.

Use it when you want to run, list, rollback, reset, and refresh CodeIgniter database migrations from `php index.php migration` without building your own migration controller.

Language
--------

[](#language)

[en-us](README.md) / [zh-tw](README-zh-tw.md)

Why This Package?
-----------------

[](#why-this-package)

CodeIgniter has a built-in migration library, but many legacy CodeIgniter 3 projects still need a simple CLI workflow for day-to-day schema changes.

This package provides that thin layer:

- No framework replacement.
- No new migration DSL.
- No application structure rewrite.
- Just a controller and library wrapper that make migrations easier to run from the command line.

It is best suited for existing CodeIgniter 3 applications that already use `application/migrations` and want a clearer operational workflow.

Features
--------

[](#features)

- Composer-installable migration helper for CodeIgniter 3.
- CLI commands for `migrate`, `rollback`, `ls`, `reset`, and `refresh`.
- Shows which migration files have already run and which are pending.
- Supports timestamp-style migration filenames such as `20001010101000_create_sample_tables.php`.
- Runs each pending migration in order and records execution state in the `migrations` table.
- Supports rolling back the latest migration or a specific migration version.
- Includes an upgrade command for converting older migration table schemas.
- Keeps migration classes compatible with CodeIgniter's `up()` and `down()` pattern.

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

[](#installation)

Install the package with Composer:

```
composer require fishingboy/codeigniter-migration
```

Quick Start
-----------

[](#quick-start)

### 1. Create the migration controller

[](#1-create-the-migration-controller)

Create `application/controllers/Migration.php`:

```
