定制 minvws/laravel-sql-exporter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

minvws/laravel-sql-exporter

最新稳定版本:v1.1.3

Composer 安装命令:

composer require minvws/laravel-sql-exporter

包简介

Laravel SQL Exporter

README 文档

README

This package is a slim package that allows you to export your Laravel database migrations to an SQL file.

Requirements

Before using the package, make sure you have the following requirements:

  • PHP 8.1 or higher
  • Laravel 10 or higher
  • Composer

Installation

Install the package via composer (as a dev dependency):

composer require --dev minvws/laravel-sql-exporter

Usage

After installing the package, you can run the following command to export your migrations to an SQL file:

vendor/bin/sail artisan sql-export migration_description

By default, the laravel migrations are read from the database/migrations folder of the working directory. By default, the SQL file will be saved in the database/sql folder of the working directory.

You can specify the laravel migrations and the output location by adding the laravelMigrationsPath or the sqlMigrationsPath arguments:

 vendor/bin/sail artisan sql-export migration_description \
 --laravelMigrationsPath=/path/to/laravel/migrations \
 --sqlMigrationsPath=/path/to/sql/migrations

Development

To contribute to the development of this package, you can clone the repository and run the following command to install the dependencies:

composer install

A running PostgreSQL database is required to run the tests. To create the database run the following command:

docker run --name laravel-sql-export-test-postgres -v "$(pwd)/tests/fixtures/init.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql" -e POSTGRES_PASSWORD=password -p 55322:5432 -d postgres || docker start laravel-sql-export-test-postgres ||  echo "Unable to start Postgres container, it may already be running"

To run the tests, you can use the following command:

vendor/bin/phpunit

To stop and remove the PostgreSQL container after running the tests, you can use:

docker stop laravel-sql-export-test-postgres
docker rm laravel-sql-export-test-postgres

Contributing

If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository of this package.

License

This package is open-source and released under the European Union Public License version 1.2. You are free to use, modify, and distribute the package in accordance with the terms of the license.

Part of iCore

This package is part of the iCore project.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2025-06-05