mirror of
https://github.com/henry4682/finance_app.git
synced 2026-07-16 00:10:00 +00:00
feat: 前端分離+功能api化
1. 新增資產管理CRUD、googleOAuth登入 2. 更改原記帳controller
This commit is contained in:
39
database/migrations/2026_06_16_183426_securities.php
Normal file
39
database/migrations/2026_06_16_183426_securities.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('securities', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('code', 20);
|
||||
$table->enum('type', ['stock', 'etf', 'fund']);
|
||||
$table->string('source', 20); // twse, tpex, cnyes
|
||||
$table->string('name'); // 中文名稱/簡稱
|
||||
|
||||
$table->decimal('latest_price', 15, 4)->nullable(); // 最新報價/淨值
|
||||
$table->timestamp('latest_price_at')->nullable(); // 最新報價/淨值時間
|
||||
$table->decimal('change_amount', 15, 4)->nullable(); // 漲跌
|
||||
$table->decimal('change_rate', 8, 4)->nullable(); // 漲跌幅(%)
|
||||
|
||||
$table->jsonb('meta')->nullable(); // 基金專屬額外資訊(category、riskLevel、isinCode...)
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['code', 'type']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('securities');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user