File: /var/www/api_matriculas/database/migrations/2014_10_12_000000_create_users_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name', 255)->nullable();
$table->string('email', 255)->nullable();
$table->string('username', 255)->nullable();
$table->string('rut', 15)->nullable();
$table->string('password', 255)->nullable();
$table->string('remember_token', 255)->nullable();
$table->string('connection_token', 255)->nullable();
$table->string('api_token', 255)->nullable();
$table->unsignedBigInteger('profile_id')->default(2);
$table->boolean('validate_password')->default(true);
$table->timestamp('last_entry')->nullable();
$table->string('activation_token', 255)->nullable();
$table->unsignedBigInteger('user_confirmed')->nullable();
$table->boolean('account_confirmed')->default(false);
$table->timestamp('account_confirmed_at')->nullable();
$table->boolean('status')->default(true);
$table->timestamps();
$table->unsignedBigInteger('user_created')->nullable();
$table->unsignedBigInteger('user_updated')->nullable();
$table->unsignedBigInteger('user_deleted')->nullable();
$table->boolean('deleted')->default(false);
$table->timestamp('deleted_at')->nullable();
// Definición de las claves foráneas
$table->foreign('profile_id')
->references('id')
->on('profiles')
->onUpdate('no action')
->onDelete('no action');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};