astylodon/migrations 问题修复 & 功能扩展

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

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

astylodon/migrations

最新稳定版本:v1.0.0

Composer 安装命令:

composer require astylodon/migrations

包简介

A simple database migrations library for PHP

README 文档

README

A simple database migrations library for PHP.

Usage

composer require astylodon/migrations

Database

This library is independent of a database implementation, instead a DatabaseInterface interface is provided that should be implemented by the database implementation.

Example

Create a file that you will invoke to run your migrations.

<?php

use Astylodon\Migrations\Migrate;

$migrate = new Migrate($database, "mysql");

$migrate->findMigrations(__DIR__ . "/migrations");
$migrate->migrate();

Migrations

Migrations should be placed inside a folder you pass to findMigrations, migrations are applied by alphabetical order. Applied migrations will be stored in a table named migrations.

<?php

// 0001_initial_create.php

use Astylodon\Migrations\Database\DatabaseInterface;
use Astylodon\Migrations\Migration;

return new class implements Migration
{
    public function up(DatabaseInterface $database)
    {
        // Your database migrations here
    }
};

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-22