feat: adds pgsql compatibility (#72)

This commit is contained in:
hackerESQ
2025-03-10 21:17:24 -05:00
committed by GitHub
parent 9e48f21c8d
commit 7ab6f79e56
15 changed files with 195 additions and 139 deletions
@@ -19,7 +19,7 @@ class CreateHoldingsTable extends Migration
Schema::create('holdings', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->foreignIdFor(Portfolio::class, 'portfolio_id')->constrained()->onDelete('cascade');
$table->string('symbol', 15);
$table->string('symbol', 25)->when(config('database.default') != 'sqlite', fn ($ctx) => $ctx->fulltext());
$table->float('quantity', 12, 4);
$table->float('average_cost_basis', 12, 4)->default(0);
$table->float('total_cost_basis', 12, 4)->default(0);
@@ -27,8 +27,6 @@ class CreateHoldingsTable extends Migration
$table->float('dividends_earned', 12, 4)->default(0);
$table->timestamp('splits_synced_at')->nullable();
$table->timestamps();
$table->foreign('symbol')->references('symbol')->on('market_data');
});
}