| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class CreateCurrenciesTable extends Migration |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | public function up() |
||
| 19 | { |
||
| 20 | Schema::create('currencies', function (Blueprint $table) { |
||
| 21 | $table->increments('id'); |
||
| 22 | $table->string('code', 3) |
||
| 23 | ->unique() |
||
| 24 | ->comment('Currency code in ISO 4217 format'); |
||
| 25 | $table->float('rate', 10, 5) |
||
| 26 | ->comment('the exchange rate'); |
||
| 27 | $table->timestamp('imported_at') |
||
| 28 | ->useCurrent() |
||
| 29 | ->comment('Timestamp returned by the API'); |
||
| 30 | $table->timestamps(); |
||
| 31 | $table->softDeletes(); |
||
| 32 | }); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function down() |
||
| 41 | } |
||
| 42 | } |
||
| 43 |