
Migration 位於 Laravel 專案包中的 database 資料夾,會使用建立日期來歸檔資料表的結構,為紀錄資料庫版本的版控,方便團隊共同開發資料表。
建立資料表
1 | php artisan make:migration create_users_table |
建立成功會顯示:

重整之後會出現新的版控檔案,使用建立日期來命名:

檔案內容:

修改資料表
在 \\wsl$
路徑下執行 migrate 的坑需要以下步驟:
補上 php 8.0 的 sql-extension
於 ubuntu 終端機輸入以下指令:
1 | 輸入code |
評論