Rename nh_network_config_id to network_id in nh_validating_agents

This commit is contained in:
Djery-Tom 2023-03-13 17:35:19 +01:00
parent 0dd7038b7f
commit d053ae86da
3 changed files with 10960 additions and 3 deletions

View File

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Model;
* Class NhValidatingDoctor * Class NhValidatingDoctor
* *
* @property int $id * @property int $id
* @property int $nh_network_config_id * @property int $network_id
* @property string|null $firstname * @property string|null $firstname
* @property string $lastname * @property string $lastname
* @property string $email * @property string $email
@ -32,7 +32,7 @@ class NhValidatingAgent extends Model
protected $table = 'nh_validating_agents'; protected $table = 'nh_validating_agents';
protected $casts = [ protected $casts = [
'nh_network_config_id' => 'int' 'network_id' => 'int'
]; ];
protected $hidden = [ protected $hidden = [
@ -41,7 +41,7 @@ class NhValidatingAgent extends Model
]; ];
protected $fillable = [ protected $fillable = [
'nh_network_config_id', 'network_id',
'firstname', 'firstname',
'lastname', 'lastname',
'email', 'email',

10923
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class RenameNhNetworkConfigIdInNhValidatingAgentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('nh_validating_agents', function (Blueprint $table) {
$table->renameColumn('nh_network_config_id', 'network_id');
DB::statement("alter table nh_validating_agents modify role enum ('DOCTOR', 'AGENT', 'CONTROLLER','OPENING_ACCOUNT_AGENT') default 'DOCTOR' not null;");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('nh_validating_agents', function (Blueprint $table) {
$table->renameColumn('network_id', 'nh_network_config_id');
});
}
}