Skip to content

Commit

Permalink
fix: remove ulid from mother primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Aug 23, 2024
1 parent 07daf94 commit bd4cdf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@
use Illuminate\Support\Facades\Schema;
use WatheqAlshowaiter\BackupTables\Constants;

/**
* @deprecated
*/
class CreateMothersTable extends Migration
{
public function up(): void
{
Schema::create('mothers', function (Blueprint $table) {
if ((float) App::version() >= Constants::VERSION_AFTER_ULID_SUPPORT && DB::connection()->getDriverName() !== 'sqlsrv') {
$table->ulid('id')->primary(); // primary key => ignored
} else {
$table->bigIncrements('id'); // primary key => ignored
}
$table->bigIncrements('id'); // primary key => ignored

$table->enum('types', ['one', 'two'])->default('one'); // default => ignored

Expand Down
3 changes: 2 additions & 1 deletion src/Models/Mother.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

use Illuminate\Database\Eloquent\Model;

class Mother extends Model {
class Mother extends Model
{
protected $guarded = ['id'];

public $timestamps = false;
Expand Down

0 comments on commit bd4cdf9

Please sign in to comment.