1: <?php
 2: 
 3: use Illuminate\Database\Schema\Blueprint;
 4: use Illuminate\Database\Migrations\Migration;
 5: 
 6: class CreateObjectEventsTable extends Migration {
 7: 
 8:     /**
 9:      * Run the migrations.
10:      *
11:      * @access   public
12:      * @return   void
13:      */
14:     public function up()
15:     {
16:         if (!Schema::hasTable('_db_object_events'))
17:         {
18:             Schema::create('_db_object_events', function ($table)
19:                     {
20:                         $table->increments('id')->unique();
21:                         $table->integer('object_id'); //links to _db_pages.id
22:                         $table->integer('event_id');
23:                     });
24:         }
25:     }
26: 
27:     /**
28:      * Reverse the migrations.
29:      *
30:      * @access   public
31:      * @return   void
32:      */
33:     public function down()
34:     {
35:         Schema::dropIfExists('_db_object_events');
36:     }
37: 
38: }
39: