Add initial Todo items and CalDAV sync
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('todos', function (Blueprint $table) {
|
||||
$table->string('id')->primary(); // ical UID
|
||||
$table->string('etag')->nullable(); // ical etag
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
$table->foreignId('type_id')->nullable()->constrained('todo_types')->nullOnDelete();
|
||||
$table->string('url')->nullable();
|
||||
$table->timestamp('due_date')->nullable();
|
||||
$table->text('recurring')->nullable(); // RRULE
|
||||
$table->tinyInteger('priority')->nullable();
|
||||
$table->string('status')->nullable(); // e.g. IN-PROCESS, NEEDS-ACTION
|
||||
$table->timestamp('created_at')->nullable(); // iCal CREATED
|
||||
$table->timestamp('last_modified')->nullable(); // iCal LAST-MODIFIED
|
||||
$table->string('parent')->nullable()->index(); // RELATED-TO (parent UID)
|
||||
$table->string('object')->nullable(); // RELATED-TO (object reference)
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('todos');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('todo_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->unique();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('todo_types');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user