eril/schemage 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eril/schemage

Composer 安装命令:

composer require eril/schemage

包简介

Schema-first database migration engine for PHP.

README 文档

README

Schema-first database migrations for PHP.

Schemage lets you describe the desired database structure with a clean PHP DSL, compare it with the current database, review a migration plan, generate SQL, and apply the required changes through a lightweight CLI.

PHP Tests License

Features

  • Schema-first PHP DSL
  • MySQL, MariaDB, and SQLite support
  • Database introspection and schema diffing
  • Table, column, index, and foreign-key operations
  • Explicit table and column renames
  • Driver-specific operation planning
  • Interactive migration plans
  • Dry-run and SQL export modes
  • Migration history and rollback support
  • Destructive-operation protection
  • Optional model generation

Installation

composer require eril/schemage

Quick Start

<?php

use Schemage\DSL\Schema;
use Schemage\DSL\Table;

return function (Schema $schema): void {
    $schema->table('users', function (Table $t): void {
        $t->id();
        $t->string('name');
        $t->string('email')->unique('users_email_unique');
        $t->timestamps();
    });
};

Preview pending changes:

vendor/bin/schemage --dry-run

Apply interactively:

vendor/bin/schemage

Apply without confirmation:

vendor/bin/schemage --yes

For non-interactive destructive migrations:

vendor/bin/schemage --yes --force

Documentation

Full documentation is available online:

https://erilshackle.github.io/schemage/

Documentation includes:

Start with:

  • docs/getting-started.md
  • docs/schema.md
  • docs/columns.md
  • docs/indexes.md
  • docs/foreign-keys.md
  • docs/cli.md

License

MIT

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固