Bổ sung migrate bảng ngày nghỉ
This commit is contained in:
parent
d69e01d6c7
commit
2cb4eabcf0
|
|
@ -13,7 +13,7 @@ return new class extends Migration
|
|||
{
|
||||
Schema::create('notes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('n_user_id');
|
||||
$table->integer('n_user_id');
|
||||
$table->integer('n_day');
|
||||
$table->integer('n_month');
|
||||
$table->integer('n_year');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?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('leave_days', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('ld_user_id'); // Giả định user_id là khóa ngoại
|
||||
$table->float('ld_day');
|
||||
$table->integer('ld_year');
|
||||
$table->float('ld_date_additional');
|
||||
$table->text('ld_note')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
// Nếu cần khóa ngoại, uncomment dòng dưới và điều chỉnh tên bảng và cột phù hợp
|
||||
// $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('leave_days');
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue