nachopitt/db-commands
最新稳定版本:v0.3.1
Composer 安装命令:
composer require nachopitt/db-commands
包简介
README 文档
README
A set of Laravel Artisan commands for database management.
Installation
You can install the package via composer:
composer require nachopitt/db-commands
Usage
db:create
Create a new MySQL database.
php artisan db:create {name?}
| Argument | Description |
|---|---|
name |
The name of the database to create. If not provided, the command will use the database name from your database.php config file. |
db:drop
Drop an existing MySQL database.
php artisan db:drop {name?}
| Argument | Description |
|---|---|
name |
The name of the database to drop. If not provided, the command will use the database name from your database.php config file. |
db:export
Export an existing MySQL database into SQL statements.
php artisan db:export {schema?}
| Argument | Description |
|---|---|
schema |
The name of the database to export. If not provided, the command will use the database name from your database.php config file. |
db:import
Import a SQL file into an existing MySQL database.
php artisan db:import {file?} {--s|schema=} {--i|ignore-foreign-key-checks}
| Argument | Description |
|---|---|
file |
The path to the SQL file to import. If not provided, the command will use database_model/{database}.sql. |
--schema |
The name of the database to import into. If not provided, the command will use the database name from your database.php config file. |
--ignore-foreign-key-checks |
Ignore foreign key checks while importing. |
db:truncate
Truncate tables from database.
php artisan db:truncate {tables?} {--s|schema=} {--i|ignore-foreign-key-checks}
| Argument | Description |
|---|---|
tables |
A comma-separated list of tables to truncate. If not provided, the command will truncate all tables in the database. |
--schema |
The name of the database to truncate tables from. If not provided, the command will use the database name from your database.php config file. |
--ignore-foreign-key-checks |
Ignore foreign key checks while truncating. |
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-03