Skip to content

Commit 43d73f1

Browse files
committed
feat: add Currency model and migration
1 parent d682821 commit 43d73f1

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration {
8+
public function up(): void
9+
{
10+
Schema::create('world_currencies', function (Blueprint $table) {
11+
$table->string('id', 3)->primary();
12+
$table->string('name');
13+
$table->string('is_active');
14+
$table->timestamps();
15+
$table->softDeletes();
16+
});
17+
}
18+
19+
public function down(): void
20+
{
21+
Schema::dropIfExists('world_currencies');
22+
}
23+
};

src/Models/Currency.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Eclipse\World\Models;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Database\Eloquent\SoftDeletes;
7+
8+
class Currency extends Model
9+
{
10+
use SoftDeletes;
11+
12+
protected $table = 'world_currencies';
13+
14+
protected $keyType = 'string';
15+
16+
public $incrementing = false;
17+
18+
protected $fillable = [
19+
'name',
20+
'is_active',
21+
];
22+
}

0 commit comments

Comments
 (0)