howyi/conv

Generate MySQL migration queries from actual DB and DDL

Maintainers

Details

github.com/howyi/conv

Source

Issues

Fund package maintenance!
howyi

v2.1.5 2024-03-21 14:56 UTC

README

Build Status Coverage Status Total Downloads

conv

Core package for howyi/conv-laravel

Generate MySQL migration queries from actual DB and DDL

composer require howyi/conv --dev

Query sample

tbl_user.sql

CREATE TABLE `tbl_user` (
  `user_id` int(11) NOT NULL COMMENT 'User ID',
  `age` tinyint(3) UNSIGNED COMMENT 'User age',
  PRIMARY KEY (`user_id`),
  KEY `id_age` (`user_id`, `age`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='User management table';

Generated migration

UP

CREATE TABLE `tbl_user` (
  `user_id` int(11) NOT NULL COMMENT 'User ID',
  `age` tinyint(3) UNSIGNED COMMENT 'User age',
  PRIMARY KEY (`user_id`),
  KEY `id_age` (`user_id`, `age`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='User management table';

DOWN

DROP TABLE `tbl_user`;

CONTRIBUTING

install

$ composer install

check (before pull-request)

$ composer check-fix