定制 helloarman/dumptable 二次开发

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

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

helloarman/dumptable

最新稳定版本:1.4.20

Composer 安装命令:

composer require helloarman/dumptable

包简介

This Laravel package updates migration files during development without data loss, allowing seamless modification of table columns while preserving existing records. Ideal for maintaining data integrity during iterative development.

README 文档

README

The Laravel Migration Updater package is a development tool designed to streamline the process of updating migration files without losing existing table data. This package is particularly useful for developers who need to modify table columns during development while preserving the integrity of the data already present.

Full Documentation: https://helloarman.github.io/dumptable

Package For

  • Laravel

Installation

Goto your laravel Project and Run -

  $ composer require helloarman/dumptable

Link storage folder

  $ php artisan storage:link

Explantation

In Laravel, updating a migration typically requires altering the entire table, which can result in the loss of data in other tables. This can be problematic if you have valuable data stored in those tables. This package allows you to update a single migration file for a specific table without affecting data in other tables, ensuring data integrity across your database.

Migrate without hamper any other table - table:dump

With this command, you can update a specific migration file without affecting the data in other tables. Simply ensure that you correctly specify your table name.

  $ php artisan table:dump {table_name} 

add -s or --seed flag for migrate with seed file

With this command, you can migrate data with seeding.

  $ php artisan table:dump {table_name} --seed

or

  $ php artisan table:dump {table_name} --s

Note: Name your seeder file with this convention: ModelNameSeeder.php

add -r or --restore flag for migrate with seed file

This is the magical one. with this you can update migration file without affecting the data in that table. It will store the data on that table as it is and update the migration column to the table only.

  $ php artisan table:dump {table_name} --restore

or

  $ php artisan table:dump {table_name} --r

backup any table into sql file

You can backup any table into a sql file with this command.

  $ php artisan table:backup {table_name}

restore any table into sql file

This command is linked with the backup command. You can restore that backups table in a sql file with this command.

  $ php artisan table:restore {table_name}

Fresh and Seed Data

This command seeds data into the specified table, deleting previous data. It is useful for resetting table data during development.

  $ Align Additional Migration File

Fresh and Seed Data

This command simplifies the process of updating a migration file in a production environment. Instead of creating a new migration file with the current date, it aligns the new file immediately after the main migration file for the table. This makes it easier to find and manage migration files, keeping the structure well-organized.

  $ php artisan table:col {type} {column_name} {table}

Badges

MIT License

MIT License

MIT License

Feedback

As this is the first release, There might be some improvement. If you need any addon or modification then do not hesitate to mention me. Contact me on -

Authors

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-25