Browse Source

Update 2014_10_12_000000_create_users_table.php

main
sergiomarquez778 1 month ago
parent
commit
9818340cfd
  1. 19
      database/migrations/2014_10_12_000000_create_users_table.php

19
database/migrations/2014_10_12_000000_create_users_table.php

@ -19,25 +19,22 @@ return new class extends Migration
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('apellido')->nullable(); $table->string('apellido')->nullable();
$table->unsignedBigInteger('puesto_id')->nullable(); $table->unsignedBigInteger('puesto_id')->nullable();
$table->unsignedBigInteger('departamento_id')->nullable(); $table->unsignedBigInteger('departamento_id')->nullable();
$table->unsignedBigInteger('tipos_id')->nullable();
$table->string('telefono')->nullable(); $table->string('telefono')->nullable();
$table->string('password'); $table->string('password');
$table->string('rol')->default('profesor');
$table->rememberToken(); $table->rememberToken();
$table->timestamps(); $table->timestamps();
$table->foreign('puesto_id')->references('id')->on('puestos'); $table->foreign('puesto_id')->references('id')->on('puestos');
$table->foreign('departamento_id')->references('id')->on('despartamentos'); $table->foreign('departamento_id')->references('id')->on('despartamentos');
$table->foreign('tipos_id')->references('id')->on('tipos');
}); });
DB::table('users')->insert([ DB::table('users')->insert([
[ [
'name'=> 'Administrador', 'name'=> 'Administrador',
'email'=> 'admin@admin.com', 'email'=> 'admin@admin.com',
'password'=> bcrypt('12345678'), 'password'=> bcrypt('12345678'),
'rol' => 'admin' 'tipos_id' => 1
], ],
[ [
'name' => 'silva', 'name' => 'silva',
@ -46,8 +43,8 @@ return new class extends Migration
'puesto_id' => 2, 'puesto_id' => 2,
'departamento_id' => 2, 'departamento_id' => 2,
'telefono' => '33652147821', 'telefono' => '33652147821',
'password' => bcrypt('12345678') 'password' => bcrypt('12345678'),
'tipos_id' => 2
], ],
[ [
'name' => 'monse', 'name' => 'monse',
@ -57,7 +54,7 @@ return new class extends Migration
'departamento_id' => 3, 'departamento_id' => 3,
'telefono' => null, 'telefono' => null,
'password' => bcrypt('12345678'), 'password' => bcrypt('12345678'),
'tipos_id' => 1
], ],
[ [
'name' => 'usuario_tipo3', 'name' => 'usuario_tipo3',
@ -67,7 +64,7 @@ return new class extends Migration
'departamento_id' => 1, 'departamento_id' => 1,
'telefono' => '3333333333', 'telefono' => '3333333333',
'password' => bcrypt('12345678'), 'password' => bcrypt('12345678'),
'tipos_id' => 3
], ],
[ [
'name' => 'usuario_tipo4', 'name' => 'usuario_tipo4',
@ -77,7 +74,7 @@ return new class extends Migration
'departamento_id' => 1, 'departamento_id' => 1,
'telefono' => '4444444444', 'telefono' => '4444444444',
'password' => bcrypt('12345678'), 'password' => bcrypt('12345678'),
'tipos_id' => 4
], ],
]); ]);
} }

Loading…
Cancel
Save