develop
Last change
on this file since 24a616f was 24a616f, checked in by Berat Kjufliju <kufliju@…>, 3 years ago |
added documents crud, added last_seen_to_user, edited views
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[24a616f] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | use Illuminate\Database\Migrations\Migration;
|
---|
| 4 | use Illuminate\Database\Schema\Blueprint;
|
---|
| 5 | use Illuminate\Support\Facades\Schema;
|
---|
| 6 |
|
---|
| 7 | class CreateDocumentsTable extends Migration
|
---|
| 8 | {
|
---|
| 9 | /**
|
---|
| 10 | * Run the migrations.
|
---|
| 11 | *
|
---|
| 12 | * @return void
|
---|
| 13 | */
|
---|
| 14 | public function up()
|
---|
| 15 | {
|
---|
| 16 | Schema::create('documents', function (Blueprint $table) {
|
---|
| 17 | $table->bigIncrements('id');
|
---|
| 18 | $table->string("arch_id")->unique();
|
---|
| 19 | $table->string("name");
|
---|
| 20 | $table->text("description");
|
---|
| 21 | $table->boolean("is_active")->default(false);
|
---|
| 22 | $table->integer("user_id")->unsigned();
|
---|
| 23 | $table->integer("department_id")->unsigned();
|
---|
| 24 | $table->timestamps();
|
---|
| 25 |
|
---|
| 26 | $table->foreign("user_id")->references("id")->on("users")->onDelete("cascade")->onUpdate("cascade");
|
---|
| 27 | $table->foreign("department_id")->references("id")->on("departments")->onDelete("cascade")->onUpdate("cascade");
|
---|
| 28 | });
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | /**
|
---|
| 32 | * Reverse the migrations.
|
---|
| 33 | *
|
---|
| 34 | * @return void
|
---|
| 35 | */
|
---|
| 36 | public function down()
|
---|
| 37 | {
|
---|
| 38 | Schema::dropIfExists('documents');
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.