Files
mytodos/database/migrations/2026_09_27_051310_create_settings_table.php
T

41 lines
1.1 KiB
PHP
Raw Normal View History

2026-10-04 20:34:19 -07:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('settings', function (Blueprint $table) {
$table->id();
$table->string('key')->unique();
$table->text('value')->nullable();
$table->timestamps();
});
// The Pro plan's advertised amount starts as whole units, matching the
// conventional price, so the pages that show it have something sensible
// to render before an administrator has ever edited it.
DB::table('settings')->insert([
'key' => 'plans.pro.amount',
'value' => '1000',
'created_at' => now(),
'updated_at' => now(),
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('settings');
}
};