Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2023_02_17_100000_tax_rates_table.php
- This file was added.
<?php | |||||
use Illuminate\Support\Facades\Schema; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Database\Migrations\Migration; | |||||
return new class extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::create('tax_rates', function (Blueprint $table) { | |||||
$table->bigIncrements('id'); | |||||
$table->string('country', 2); | |||||
$table->timestamp('start')->useCurrent(); | |||||
$table->float('rate', 5, 2); | |||||
$table->unique(['country', 'start']); | |||||
}); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::dropIfExists('tax_rates'); | |||||
} | |||||
}; |