Files
iro2-back-lecture/database/migrations/2025_11_13_104322_create_habits_table.php
2025-11-13 14:09:08 +03:00

34 lines
800 B
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('habits', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->text('description');
$table->integer('target_count');
$table->integer('current_count');
$table->jsonb('completions');
$table->boolean('is_completed')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('habits');
}
};