lastdragon-ru/lara-asp-migrator
Composer 安装命令:
composer require lastdragon-ru/lara-asp-migrator
包简介
Improves standard Laravel migrations to add support for raw SQL files during migration and seeding. So you can easily use your favorite visual tool for database development with Laravel.
关键字:
README 文档
README
This package improves standard Laravel migrations to add support for raw SQL files during migration and seeding. So you can easily use your favorite visual tool for database development like MySQL Workbench with Laravel 🥳
Important
The Migrator uses the same mechanism as Squashing Migrations so not all databases are supported, please see Laravel Documentation for more details.
Requirements
| Requirement | Constraint | Supported by |
|---|---|---|
| PHP | ^8.5 |
HEAD ⋯ 11.0.0 |
^8.4 |
HEAD ⋯ 8.0.0 |
|
^8.3 |
10.3.0 ⋯ 5.0.0 |
|
^8.2 |
7.2.0 ⋯ 2.0.0 |
|
^8.1 |
6.4.2 ⋯ 2.0.0 |
|
^8.0 |
4.6.0 ⋯ 2.0.0 |
|
^8.0.0 |
1.1.2 ⋯ 0.12.0 |
|
>=8.0.0 |
0.11.0 ⋯ 0.4.0 |
|
>=7.4.0 |
0.3.0 ⋯ 0.1.0 |
|
| Laravel | ^13.10.0 |
HEAD , 11.1.0 |
^13.0.0 |
11.0.0 |
|
^12.0.1 |
10.3.0 ⋯ 9.0.0 |
|
^11.0.8 |
8.1.1 ⋯ 8.0.0 |
|
^11.0.0 |
7.2.0 ⋯ 6.2.0 |
|
^10.34.0 |
7.2.0 ⋯ 6.2.0 |
|
^10.0.0 |
6.1.0 ⋯ 2.1.0 |
|
^9.21.0 |
5.6.0 ⋯ 5.0.0-beta.1 |
|
^9.0.0 |
5.0.0-beta.0 ⋯ 0.12.0 |
|
^8.22.1 |
3.0.0 ⋯ 0.2.0 |
|
^8.0 |
0.1.0 |
Installation
composer require lastdragon-ru/lara-asp-migrator
Migrations
To create migration, just use the following command:
php artisan lara-asp-migrator:sql-migration MyMigration
It will create the following files in database/migrations:
2020_11_05_170802_my_migration.php
2020_11_05_170802_my_migration~down.sql
2020_11_05_170802_my_migration~up.sql
Usually, you just need to put your SQL into *~up.sql and *~down.sql 😇 Note that you still can use standard Laravel migrations. Also, migrations can be placed into subdirectories.
Seeders
The package uses a bit different approach compared with standard and provides a few different types of seeders:
Seeder- unlike standardSeederit is safer and will not run seeder if it is already applied (so it is safe for production 🤩);SqlSeeder- extendsSmartSeederand allow you to use SQL.
To create SQL Seeder you should use the command:
php artisan lara-asp-migrator:sql-seeder MySeeder
The command will create two files:
MySeeder.php- The class can be used to customizeisSeeded()method, e.g. you can check if a model exists in the database.MySeeder.sql- the file where the SQL seed stored.
Upgrading
Please follow Upgrade Guide.
Contributing
Please use the main repository to report issues, send pull requests, or ask questions.
lastdragon-ru/lara-asp-migrator 适用场景与选型建议
lastdragon-ru/lara-asp-migrator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.95k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「php」 「sql」 「mysql」 「laravel」 「database migration」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lastdragon-ru/lara-asp-migrator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lastdragon-ru/lara-asp-migrator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lastdragon-ru/lara-asp-migrator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Query filtering in your frontend
A PSR-7 compatible library for making CRUD API endpoints
Database/ORM-agnostic query construction helper
统计信息
- 总下载量: 7.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-19