Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Capsule::schema()->create('categories', function($table)
- {
- $table->increments('id');
- $table->string('name')->unique();
- $table->timestamps();
- });
- Capsule::schema()->create('items', function($table)
- {
- $table->increments('id');
- $table->string('name');
- $table->text('description')->nullable();
- $table->boolean('important')->default(false);;
- $table->boolean('done')->default(false);
- $table->unsignedInteger('category_id');
- $table->index('category_id');
- $table->foreign('category_id')->references('id')->on('categories');
- $table->timestamps();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement