Commit 40390e35 authored by Abraão Barbosa's avatar Abraão Barbosa
Browse files

change unidade_id field to campus_id in users table

parent 2dde2092
...@@ -30,7 +30,7 @@ class User extends Authenticatable ...@@ -30,7 +30,7 @@ class User extends Authenticatable
* *
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = ['name', 'email', 'password', 'document', 'type', 'status', 'curso_id', 'unidade_id']; protected $fillable = ['name', 'email', 'password', 'document', 'type', 'status', 'curso_id', 'campus_id'];
/** /**
* The attributes that should be hidden for serialization. * The attributes that should be hidden for serialization.
......
...@@ -23,7 +23,7 @@ class CreateUsersTable extends Migration ...@@ -23,7 +23,7 @@ class CreateUsersTable extends Migration
$table->string('document'); $table->string('document');
$table->tinyInteger('status'); $table->tinyInteger('status');
$table->foreignId('curso_id')->nullable(); $table->foreignId('curso_id')->nullable();
$table->foreignId('unidade_id')->nullable(); $table->foreignId('campus_id')->nullable();
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCursoInUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Schema::table('users', function (Blueprint $table) {
// $table->foreignId('curso_id')->nullable();
// });
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// if(Schema::hasColumn('users', 'curso_id')) {
// Schema::dropColumns('users', ['curso_id']);
// }
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RemoveFieldCursoId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUnidadeInUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Schema::create('users', function (Blueprint $table) {
// $table->foreignId('unidade_id')->nullable();
// });
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// if(Schema::hasColumn('users', 'unidade_id')) {
// Schema::dropColumns('users', ['unidade_id']);
// }
}
}
...@@ -30,7 +30,7 @@ class UserSeeder extends Seeder ...@@ -30,7 +30,7 @@ class UserSeeder extends Seeder
'password' => Hash::make('@professor'), 'password' => Hash::make('@professor'),
'document' => "00000000{$id}", 'document' => "00000000{$id}",
'status' => User::STATUS_ACTIVE, 'status' => User::STATUS_ACTIVE,
'unidade_id' => 3, 'campus_id' => 3,
'curso_id' => 1, 'curso_id' => 1,
]); ]);
} }
...@@ -44,7 +44,7 @@ class UserSeeder extends Seeder ...@@ -44,7 +44,7 @@ class UserSeeder extends Seeder
'password' => Hash::make('12345678'), 'password' => Hash::make('12345678'),
'document' => "100000000", 'document' => "100000000",
'status' => User::STATUS_ACTIVE, 'status' => User::STATUS_ACTIVE,
'unidade_id' => NULL, 'campus_id' => NULL,
'curso_id' => NULL, 'curso_id' => NULL,
]); ]);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment