1: <?php
2:
3: use Illuminate\Database\Migrations\Migration;
4: use Illuminate\Database\Schema\Blueprint;
5: use Illuminate\Database\Capsule\Manager as Capsule;
6:
7: class CreateAdavSharedAddressbooksTable extends Migration
8: {
9: /**
10: * Run the migrations.
11: *
12: * @return void
13: */
14: public function up()
15: {
16: Capsule::schema()->create('adav_shared_addressbooks', function (Blueprint $table) {
17: $table->increments('id');
18: $table->string('principaluri')->index();
19: $table->unsignedTinyInteger('access')->default(0);
20: $table->unsignedInteger('addressbook_id');
21: $table->foreign('addressbook_id')->references('id')->on('adav_addressbooks')->cascadeOnDelete();
22: $table->uuid('addressbookuri');
23: });
24: }
25:
26: /**
27: * Reverse the migrations.
28: *
29: * @return void
30: */
31: public function down()
32: {
33: Capsule::schema()->dropIfExists('adav_shared_addressbooks');
34: }
35: }
36: