feat: note

This commit is contained in:
hashbro
2026-09-08 04:53:35 +08:00
parent 9626fcc598
commit c1d24ab815
19 changed files with 870 additions and 58 deletions
@@ -0,0 +1,24 @@
<?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::table('notes', function (Blueprint $table) {
$table->string('content_hash', 64)->nullable()->after('content');
$table->index(['device_id', 'content_hash']);
});
}
public function down(): void
{
Schema::table('notes', function (Blueprint $table) {
$table->dropIndex(['device_id', 'content_hash']);
$table->dropColumn('content_hash');
});
}
};
@@ -0,0 +1,22 @@
<?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::table('devices', function (Blueprint $table) {
$table->char('country', 2)->nullable()->after('ip');
});
}
public function down(): void
{
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('country');
});
}
};