smithery.ai

backend-database-migrations

Database versioning, migration best practices.

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,533 B
  • docs SUMMARY.md 81 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Backend Database Migrations

When to use this skill

  • Database schema changes
  • Version control for database
  • Deploying schema updates
  • Team collaboration

Workflow

  • Create migration files
  • Write up() and down()
  • Run migrations
  • Track in version control
  • Never edit existing migrations

Instructions

Create Migration

php spark make:migration add_users_table

Migration File

<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddUsersTable extends Migration
{
    public function up()
    {
        $this->forge->addField([
            'id' => [
                'type' => 'INT',
                'constraint' => 11,
                'unsigned' => true,
                'auto_increment' => true
            ],
            'email' => [
                'type' => 'VARCHAR',
                'constraint' => 255,
                'unique' => true
            ],
            'created_at' => [
                'type' => 'DATETIME',
                'null' => true
            ]
        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('users');
    }

    public function down()
    {
        $this->forge->dropTable('users');
    }
}

Run Migrations

php spark migrate
php spark migrate:rollback

Resources

  • Always write down() method
  • Test rollback
  • Never modify existing migrations