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) $table->unsignedBigInteger('todoable_id'); $table->string('todoable_type'); $table->index(['id', 'todoable_id', 'todoable_type']); }); } public function down(): void { Schema::dropIfExists('todos'); } };