Skip to content

Commit

Permalink
docs: improve complex to be correct in Laravel 9, which has ulid() de…
Browse files Browse the repository at this point in the history
…fault name is uuid
  • Loading branch information
WatheqAlshowaiter committed Jul 15, 2024
1 parent 8b0a415 commit b88cd70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ Schema::create('posts', function (Blueprint $table) {
$table->foreignId('user_id')->constrained(); // required
$table->foreignId('category')->nullable(); // nullable
$table->uuid(); // required (but will be changed later) 👇
$table->ulid()->nullable(); // nullable (but will be changed later) 👇
$table->ulid('ulid')->nullable(); // nullable (but will be changed later) 👇
$table->boolean('active')->default(false); // default
$table->string('title'); // required
$table->json('description')->nullable(); // nullable (but will be changed later) 👇
$table->json('description'); // nullable (but will be changed later) 👇
$table->string('slug')->nullable()->unique(); // nullable
$table->timestamps(); // nullable
$table->softDeletes(); // nullable
});

// later migration..
Schema::table('posts', function(Blueprint $table){
$table->json('description')->change(); // required
$table->ulid()->nullable(false)->change(); // required
$table->json('description')->nullable(false)->change(); // required
$table->ulid('ulid')->nullable(false)->change(); // required
$table->uuid()->nullable()->change(); // nullable
});
```
Expand Down

0 comments on commit b88cd70

Please sign in to comment.