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'); } };