Advertisement
nocturnalmk

Untitled

Nov 19th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. Capsule::schema()->create('categories', function($table)
  2. {
  3.     $table->increments('id');
  4.     $table->string('name')->unique();
  5.     $table->timestamps();
  6. });
  7.  
  8. Capsule::schema()->create('items', function($table)
  9. {
  10.     $table->increments('id');
  11.     $table->string('name');
  12.     $table->text('description')->nullable();
  13.     $table->boolean('important')->default(false);;
  14.     $table->boolean('done')->default(false);
  15.     $table->unsignedInteger('category_id');
  16.     $table->index('category_id');
  17.     $table->foreign('category_id')->references('id')->on('categories');
  18.     $table->timestamps();
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement