src/Modules/Permissions/Database/Migrations/2016_01_05_130506_permissions.php 1 location
|
@@ 23-32 (lines=10) @@
|
| 20 |
|
$table->timestamps(); |
| 21 |
|
$table->unique(array('name', 'model')); |
| 22 |
|
}); |
| 23 |
|
Schema::create('roles_permissions', function (Blueprint $table) { |
| 24 |
|
$table->increments('id'); |
| 25 |
|
$table->integer('role_id'); |
| 26 |
|
$table->integer('permission_id'); |
| 27 |
|
$table->softDeletes(); |
| 28 |
|
$table->timestamps(); |
| 29 |
|
|
| 30 |
|
$table->foreign('role_id')->references('id')->on('roles'); |
| 31 |
|
$table->foreign('permission_id')->references('id')->on('permissions'); |
| 32 |
|
}); |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
/** |
src/Modules/PushNotificationDevices/Database/Migrations/2016_01_24_111942_push_notification_devices.php 1 location
|
@@ 13-26 (lines=14) @@
|
| 10 |
|
* |
| 11 |
|
* @return void |
| 12 |
|
*/ |
| 13 |
|
public function up() |
| 14 |
|
{ |
| 15 |
|
Schema::create('push_notification_devices', function (Blueprint $table) { |
| 16 |
|
$table->increments('id'); |
| 17 |
|
$table->string('device_token'); |
| 18 |
|
$table->integer('user_id'); |
| 19 |
|
$table->text('access_token')->nullable(); |
| 20 |
|
$table->unique(array('device_token', 'user_id')); |
| 21 |
|
$table->softDeletes(); |
| 22 |
|
$table->timestamps(); |
| 23 |
|
|
| 24 |
|
$table->foreign('user_id')->references('id')->on('users'); |
| 25 |
|
}); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
/** |
| 29 |
|
* Reverse the migrations. |
src/Modules/Roles/Database/Migrations/2015_12_22_145819_roles.php 1 location
|
@@ 22-31 (lines=10) @@
|
| 19 |
|
$table->timestamps(); |
| 20 |
|
}); |
| 21 |
|
|
| 22 |
|
Schema::create('users_roles', function (Blueprint $table) { |
| 23 |
|
$table->increments('id'); |
| 24 |
|
$table->integer('user_id'); |
| 25 |
|
$table->integer('role_id'); |
| 26 |
|
$table->softDeletes(); |
| 27 |
|
$table->timestamps(); |
| 28 |
|
|
| 29 |
|
$table->foreign('user_id')->references('id')->on('users'); |
| 30 |
|
$table->foreign('role_id')->references('id')->on('roles'); |
| 31 |
|
}); |
| 32 |
|
|
| 33 |
|
/** |
| 34 |
|
* Create Default roles. |