Category : uuid

I’ve tried almost every remedy that I know of, but it doesn’t work. However, when I use the command php artisan db:seed seed it works as it should General error: 1364 Field ‘uuid’ doesn’t have a default value enter image description here This is my Models: <?php namespace AppModels; use AppEnumsProjectStatus; use IlluminateDatabaseEloquentFactoriesHasFactory; use IlluminateDatabaseEloquentModel; ..

Read more

Laravel: 7; PHP: 7.4/8.0 In my project I have two related models: User and TimeAccount. Both use UUID for their primary key, the key name is still id. Migrations: class CreateUsersTable extends Migration { public function up() { Schema::create(‘users’, function (Blueprint $table) { $table->uuid(‘id’)->primary(); // snip… }); } // snip… } class CreateTimeAccountsTable extends Migration ..

Read more

I’m trying to use Uuids as foreign keys in my database. I want the Admin table to reference the User table. The database is PostgreSQL, but it should work anywway. The Users’ table: Schema::create(‘users’, function (Blueprint $table) { $table->uuid(‘id’)->primary(); $table->string(‘name’, 80); $table->string(’email’, 80)->unique(); … }); My Admins’ table: Schema::create(‘administrators’, function (Blueprint $table) { $table->increments(‘id’); $table->uuid(‘fk_user_id’); ..

Read more

I have 2 tables categories and posts and third table category_posts is pivot table to relate those two tables. Issue The problem is that I use uuid for my tables and when new row will add to category_posts it does not get uuid so second row will throw error as ids aren’t unique (both are ..

Read more