PHPackages                             rajibahmed/rake-db-migrator - 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. rajibahmed/rake-db-migrator

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

rajibahmed/rake-db-migrator
===========================

Rails migration for php projects

8121Ruby

Since Jan 10Pushed 12y ago2 watchersCompare

[ Source](https://github.com/rajibahmed/rake-db-migrator)[ Packagist](https://packagist.org/packages/rajibahmed/rake-db-migrator)[ RSS](/packages/rajibahmed-rake-db-migrator/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Rails Less Migration
====================

[](#rails-less-migration)

Today I was wanted to use rails goodness inside of my php project. So, I searched online found a solution somewhere. Fixed it up for any project to use using composer.

I assume you are using tools listed below and know how to use command line.

- POSIX OS
- Ruby the programming Language
- Rake the build tool written in Ruby
- Activerecord gem, defaults with Rails !!!!

To enable it, add this dependency to your `composer.json` file:

```
"rajibahmed/rake-db-migrator": "dev"

```

Step 1: To enable it in your application you need to create few directories from you terminal :)

```
$ mkdir -p db/migrate
$ mkdir config

```

Note 1: You do not need to create the structure if you already have it. Note 2: I have provided a demo database.yml configuration file copy over to config folder. Important: If you don't have valid database.yml this generator will not work.

Step 2: symlink my rake file to root of you project.

```
$ ln -s vendor/rajibahmed/rake-db-migrator/Rakefile .

```

Step 3: You are done !!

Usage
=====

[](#usage)

So now you can use this rake file to create and migrate you configured database. Available Rake tasks are,

```
 rake db:create    # Create the database from config/database.yml for the current DATABASE_ENV
 rake db:drop      # Drops the database for the current DATABASE_ENV
 rake db:generate  # Generate migration files
 rake db:migrate   # Migrate the database (options: VERSION=x, VERBOSE=false).
 rake db:rollback  # Rolls the schema back to the previous version (specify steps w/ STEP=n).
 rake db:version   # Retrieves the current schema version number

```

Now, Running

```
rake db:generate

```

Will create a template file that you can use as a reference point for writing your first migration.

Note\[IMPORTANT\] : Class name in a migration file must match the file naming convention. ie.

Name migration file
===================

[](#name-migration-file)

Now you can pass in the migration file name. But follow the convention underscore word.

```
rake db:generate[create_users]

```

This will generate code like this.

```
     # db/migrate/....._create_user.rb
     CreateUser < ActiveRecord::Migration
     # file name should be timestramp_create_user.rb
     end
```

You are good to go !!! This is a few hours effort. If you want to extend it please fork it or send me emails.

LICENSE: Do whatever you want with it. I don't want money from you and can't be held responsible any fu\*k ups. Good luck !!! Simple isn't it.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66739?v=4)[Rajib Ahmed](/maintainers/rajibahmed)[@rajibahmed](https://github.com/rajibahmed)

---

Top Contributors

[![rajibahmed](https://avatars.githubusercontent.com/u/66739?v=4)](https://github.com/rajibahmed "rajibahmed (3 commits)")[![jaggy](https://avatars.githubusercontent.com/u/1993075?v=4)](https://github.com/jaggy "jaggy (1 commits)")

### Embed Badge

![Health badge](/badges/rajibahmed-rake-db-migrator/health.svg)

```
[![Health](https://phpackages.com/badges/rajibahmed-rake-db-migrator/health.svg)](https://phpackages.com/packages/rajibahmed-rake-db-migrator)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M114](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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