Laravel 8 重命名 / 刪除數(shù)據(jù)表

2021-07-19 11:19 更新

若要重命名數(shù)據(jù)表,可以使用 rename 方法:

Schema::rename($from, $to); 

刪除一個(gè)已存在的數(shù)據(jù)表, 可使用 dropdropIfExists 方法:

Schema::drop('users');

Schema::dropIfExists('users'); 
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)