source: database/migrations/2021_10_06_103305_create_folders_table.php@ 7043def

develop
Last change on this file since 7043def was 5e56e8a, checked in by beratkjufliju <kufliju@…>, 3 years ago

edited faker

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[24a616f]1<?php
2
3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
6
[c6b84df]7class CreateFoldersTable extends Migration
[24a616f]8{
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
[c6b84df]16 Schema::create('folders', function (Blueprint $table) {
[5e56e8a]17 $table->bigIncrements('id')->startingValue(1);
[24a616f]18 $table->string("arch_id")->unique();
19 $table->string("name");
[c6b84df]20 $table->text("note")->nullable();
21 $table->string("location");
[4b7e2d3]22 $table->integer("no_of_files")->default(0);
[24a616f]23 $table->integer("user_id")->unsigned();
24 $table->integer("department_id")->unsigned();
[c6b84df]25 $table->boolean("is_important")->default(false);
[24a616f]26 $table->timestamps();
27
28 $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
29 $table->foreign("department_id")->references("id")->on("departments")->onDelete("cascade")->onUpdate("cascade");
30 });
31 }
32
33 /**
34 * Reverse the migrations.
35 *
36 * @return void
37 */
38 public function down()
39 {
[c6b84df]40 Schema::dropIfExists('folders');
[24a616f]41 }
42}
Note: See TracBrowser for help on using the repository browser.