| @@ 4-29 (lines=26) @@ | ||
| 1 | <?php |
|
| 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
| 3 | ||
| 4 | class CreateRolesTable |
|
| 5 | { |
|
| 6 | /** |
|
| 7 | * Do the migration |
|
| 8 | */ |
|
| 9 | public function up() |
|
| 10 | { |
|
| 11 | Capsule::schema()->create('roles', function($table) { |
|
| 12 | $table->increments('id'); |
|
| 13 | $table->string('name')->unique(); |
|
| 14 | $table->string('description'); |
|
| 15 | $table->integer('created_by')->nullable(); |
|
| 16 | $table->integer('updated_by')->nullable(); |
|
| 17 | $table->timestamps(); |
|
| 18 | $table->softDeletes(); |
|
| 19 | }); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Undo the migration |
|
| 24 | */ |
|
| 25 | public function down() |
|
| 26 | { |
|
| 27 | Capsule::schema()->drop('roles'); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| @@ 4-30 (lines=27) @@ | ||
| 1 | <?php |
|
| 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
| 3 | ||
| 4 | class CreateRightsTable |
|
| 5 | { |
|
| 6 | /** |
|
| 7 | * Do the migration |
|
| 8 | */ |
|
| 9 | public function up() |
|
| 10 | { |
|
| 11 | Capsule::schema()->create('rights', function($table) { |
|
| 12 | $table->increments('id'); |
|
| 13 | $table->string('name')->unique(); |
|
| 14 | $table->string('description'); |
|
| 15 | $table->integer('created_by')->nullable(); |
|
| 16 | $table->integer('updated_by')->nullable(); |
|
| 17 | $table->timestamps(); |
|
| 18 | $table->softDeletes(); |
|
| 19 | }); |
|
| 20 | ||
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Undo the migration |
|
| 25 | */ |
|
| 26 | public function down() |
|
| 27 | { |
|
| 28 | Capsule::schema()->drop('rights'); |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||
| @@ 4-29 (lines=26) @@ | ||
| 1 | <?php |
|
| 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
| 3 | ||
| 4 | class CreateLogsTable |
|
| 5 | { |
|
| 6 | /** |
|
| 7 | * Do the migration |
|
| 8 | */ |
|
| 9 | public function up() |
|
| 10 | { |
|
| 11 | Capsule::schema()->create('logs', function($table) { |
|
| 12 | $table->increments('id'); |
|
| 13 | $table->string('action'); |
|
| 14 | $table->morphs('entity'); |
|
| 15 | $table->text('state')->nullable(); |
|
| 16 | $table->timestamp('created_at')->useCurrent(); |
|
| 17 | $table->integer('created_by')->nullable(); |
|
| 18 | }); |
|
| 19 | ||
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Undo the migration |
|
| 24 | */ |
|
| 25 | public function down() |
|
| 26 | { |
|
| 27 | Capsule::schema()->drop('logs'); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| @@ 5-30 (lines=26) @@ | ||
| 2 | ||
| 3 | use Illuminate\Database\Capsule\Manager as Capsule; |
|
| 4 | ||
| 5 | class CreateMediaFilesTable |
|
| 6 | { |
|
| 7 | /** |
|
| 8 | * Do the migration |
|
| 9 | */ |
|
| 10 | public function up() |
|
| 11 | { |
|
| 12 | Capsule::schema()->create('media_files', function($table) { |
|
| 13 | $table->increments('id'); |
|
| 14 | $table->string('file'); |
|
| 15 | $table->string('file_info'); |
|
| 16 | $table->integer('created_by')->nullable()->unsigned(); |
|
| 17 | $table->integer('updated_by')->nullable()->unsigned(); |
|
| 18 | $table->timestamps(); |
|
| 19 | }); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Undo the migration |
|
| 24 | */ |
|
| 25 | public function down() |
|
| 26 | { |
|
| 27 | Capsule::schema()->drop('media_files'); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||