41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?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');
|
||
|
|
}
|
||
|
|
};
|