id(); $table->foreignId('company_id')->constrained()->cascadeOnDelete(); $table->string('name', 100); $table->string('code')->index(); $table->decimal('rate', 15, 8); $table->unsignedTinyInteger('precision')->default(2); $table->string('symbol')->default('$'); $table->boolean('symbol_first')->default(true); $table->string('decimal_mark')->default('.'); $table->string('thousands_separator')->default(','); $table->boolean('enabled')->default(true); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps(); $table->unique(['company_id', 'code']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('currencies'); } };