mirror of
https://gh.wpcy.net/https://github.com/aspirepress/AspireCloud.git
synced 2026-07-18 11:39:23 +08:00
* fix: disable telescope for several commands including migrations * feat: consolidated, rewritten, and simplified migrations * tweak: enforce use of postgres, our only supported db * tweak: use text instead of varchar this is considered best practice in postgres, as there is absolutely no difference between text and varchar. if a column size limit is critical, the constraint should be added separately. * refactor: simplify all types, inline and fix ->timestamps() * refactor: change all jsonb props to computed using Laravel's Attributes * refactor: do all metadata rewrites on the fly instead of load time
20 lines
607 B
PHP
20 lines
607 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration {
|
|
public function up(): void
|
|
{
|
|
if (Schema::getConnection()->getDriverName() !== 'pgsql') {
|
|
throw new RuntimeException('AspireCloud only supports running on Postgres');
|
|
}
|
|
|
|
if (Schema::hasTable('migrations') && DB::table('migrations')->select('id')->exists()) {
|
|
throw new RuntimeException('Existing migrations detected -- aborting');
|
|
}
|
|
}
|
|
|
|
public function down(): void {}
|
|
};
|