W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
結(jié)構(gòu)生成器支持多種索引類型,有兩種方法可以加入,方法一,您可以在定義字段時(shí)順便附加上去,或者是分開另外加入:
$table->string('email')->unique();
或者,您可以獨(dú)立一行來(lái)加入索引,以下是支持的索引類型: | 命令 | 功能描述 |
---|---|---|
$table->primary('id'); | 加入主鍵 (primary key) | |
$table->primary(array('first', 'last')); | 加入復(fù)合鍵 (composite keys) | |
$table->unique('email'); | 加入唯一索引 (unique index) | |
$table->index('state'); | 加入基本索引 (index) |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: