clive0417/d-b-diagram-regular-parse

A d b diagram regular parse

v1.0.5 2022-11-06 14:41 UTC

This package is auto-updated.

Last update: 2024-11-06 18:47:31 UTC


README

GitHub Workflow Status styleci

Packagist Packagist Packagist

Package description: CHANGE ME

Installation

Install via composer

composer require clive0417/d-b-diagram-regular-parse

Publish package assets

php artisan vendor:publish --provider="Clive0417\DBDiagramRegularParse\ServiceProvider"

Usage

使用方法請參考影片

https://youtu.be/4fopuupr1Mk

step1 安裝套件

composer require clive0417/d-b-diagram-regular-parse

step2 複製 DB Diagram 並存檔

//商家
table merchants [headercolor: #16a085]
{
  id                            bigint(20)          [pk, increment, note: '流水號']
  uuid                          char(36)            [unique, note: 'uuid']
  name                          varchar(250)        [null, note:'名稱']
  company_tax_id_number         varchar(10)         [note:'統編']
  status                        smallint(5)         [default: 201, note: '狀態']
  deleted_at                    timestamp
  created_at                    timestamp
  updated_at                    timestamp

  indexes{
    uuid                                [unique, note: 'uuid索引']
    company_tax_id_number               [note: '統編索引']
    (status, deleted_at)                [note: '狀態索引']
  }
}
....

step3 執行 解析 DB Diagram 產生 migration 檔指令

php artisan clive0417:migration_generate --db_diagram_path="{{DB Diagram 檔案路徑}}"

step4 執行 laravel migrate 指令,建立DB table

php artisan migrate

step5 執行讀取DB 產生 model 檔指令

php artisan clive0417:model_generate

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits

This package is bootstrapped with the help of melihovv/laravel-package-generator.