From 40390e3524b98056d26eb5ffe53a17b2ef6a9deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abra=C3=A3o=20Barbosa?= Date: Sun, 22 May 2022 16:54:08 -0300 Subject: [PATCH] change unidade_id field to campus_id in users table --- app/Models/User.php | 2 +- .../2014_10_12_000000_create_users_table.php | 2 +- ..._02_014728_create_curso_in_users_table.php | 32 ------------------- ...022_02_22_021925_remove_field_curso_id.php | 28 ---------------- ...1_131811_create_unidade_in_users_table.php | 32 ------------------- database/seeders/UserSeeder.php | 4 +-- 6 files changed, 4 insertions(+), 96 deletions(-) delete mode 100644 database/migrations/2022_02_02_014728_create_curso_in_users_table.php delete mode 100644 database/migrations/2022_02_22_021925_remove_field_curso_id.php delete mode 100644 database/migrations/2022_03_11_131811_create_unidade_in_users_table.php diff --git a/app/Models/User.php b/app/Models/User.php index c76378f..329c5a6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -30,7 +30,7 @@ class User extends Authenticatable * * @var array */ - 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. diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 88e370a..3b64910 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -23,7 +23,7 @@ class CreateUsersTable extends Migration $table->string('document'); $table->tinyInteger('status'); $table->foreignId('curso_id')->nullable(); - $table->foreignId('unidade_id')->nullable(); + $table->foreignId('campus_id')->nullable(); $table->rememberToken(); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2022_02_02_014728_create_curso_in_users_table.php b/database/migrations/2022_02_02_014728_create_curso_in_users_table.php deleted file mode 100644 index 724bdb2..0000000 --- a/database/migrations/2022_02_02_014728_create_curso_in_users_table.php +++ /dev/null @@ -1,32 +0,0 @@ -foreignId('curso_id')->nullable(); - // }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // if(Schema::hasColumn('users', 'curso_id')) { - // Schema::dropColumns('users', ['curso_id']); - // } - } -} diff --git a/database/migrations/2022_02_22_021925_remove_field_curso_id.php b/database/migrations/2022_02_22_021925_remove_field_curso_id.php deleted file mode 100644 index 409d5f2..0000000 --- a/database/migrations/2022_02_22_021925_remove_field_curso_id.php +++ /dev/null @@ -1,28 +0,0 @@ -foreignId('unidade_id')->nullable(); - // }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // if(Schema::hasColumn('users', 'unidade_id')) { - // Schema::dropColumns('users', ['unidade_id']); - // } - } -} diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 0941985..09905ff 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -30,7 +30,7 @@ class UserSeeder extends Seeder 'password' => Hash::make('@professor'), 'document' => "00000000{$id}", 'status' => User::STATUS_ACTIVE, - 'unidade_id' => 3, + 'campus_id' => 3, 'curso_id' => 1, ]); } @@ -44,7 +44,7 @@ class UserSeeder extends Seeder 'password' => Hash::make('12345678'), 'document' => "100000000", 'status' => User::STATUS_ACTIVE, - 'unidade_id' => NULL, + 'campus_id' => NULL, 'curso_id' => NULL, ]); } -- GitLab