Birmingham mumbai


$table->nullableTimestamps()


Download 1.3 Mb.
Pdf ko'rish
bet64/68
Sana05.01.2022
Hajmi1.3 Mb.
#227543
1   ...   60   61   62   63   64   65   66   67   68
Bog'liq
Laravel 5 Essentials

$table->nullableTimestamps();

This is similar to timestamps (next), but allows 

NULL

 values


$table->rememberToken();

It adds a remember_token VARCHAR column



$table->tinyInteger('name');

It creates a TINYINT column



$table->softDeletes();

It adds a deleted_at column for soft deletes



$table->string('name');

It creates a VARCHAR column



$table->string('name', 255);

It creates a VARCHAR column of the given length



$table->text('name');

It creates a TEXT column



$table->time('name');

It creates a TIME column



$table->timestamp('name');

It creates a TIMESTAMP column



$table->timestamps();

It creates created_at and deleted_at 

columns



Chapter 3

[

 33 

]

We've also created a foreign key in the 

cats

 migration. This links the 



breed_id

 

column value to an ID in the 



breeds

 table. This is so that we don't have to keep 

specifying the breed name over and over again. We can just reference one record in the 

breeds


 table. If that record is updated, then all 

cats


 linked to it will also be updated.

To run both of the migrations, enter the following command:




Download 1.3 Mb.

Do'stlaringiz bilan baham:
1   ...   60   61   62   63   64   65   66   67   68




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling