%PDF- %PDF-
| Direktori : /home/vacivi36/core/database/migrations/ |
| Current File : /home/vacivi36/core/database/migrations/2024_10_30_000005_create_vaccines_table.php |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVaccinesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vaccines', function (Blueprint $table) {
$table->id();
$table->string('name'); // nome da vacina
$table->string('code'); // codigo da vacina
$table->string('batch'); // lote
$table->integer('quantity'); // quantidade
$table->date('due_date'); // data de vencimento
$table->integer('doses'); // doses
$table->unsignedBigInteger('campaign_id'); // id da campanha
$table->date('manufacturing_date')->nullable(); // data de fabricação
$table->string('laboratory')->nullable(); // laboratório
$table->string('application_location')->nullable(); // local de aplicacao
$table->text('notes')->nullable(); // observações
$table->timestamps(); // created at e updated at
$table->softDeletes();
// Chave estrangeira para campanhas
$table->foreign('campaign_id')->references('id')->on('campaigns')->onDelete('restrict');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('vaccines');
}
}