Then I have a second migration, which drops the user_id column:public function up(): void { $isSqlite = \Illuminate\Support\Facades\DB::getDriverName() === 'sqlite'; Schema::table('project_assignments', function (Blueprint $table) use ($isSqlite) { if (! $isSqlite) { $table->...
Install the package in a Laravel Nova project via Composer:# Install package composer require outl1ne/nova-sortableUsageCreate migrationAdd an order field to the model using Laravel migrations:// Add order column to the model Schema::table('some_model', function (Blueprint $table) { $table-...
Create migrationAdd an order field to the model using Laravel migrations:// Add order column to the model Schema::table('some_model', function (Blueprint $table) { $table->integer('sort_order'); }); // Set default sort order (just copy ID to sort order) DB::statement('UPDATE some...
I have a similar situation where I want to remove just the key constrain not the column and not working. I do not know why, maybe you can help me. Take a look at my code: --migration for creating the table-- classCreateUnitRoomTypePricesTableextendsMigration{/** * Run the migrations...
Install the package in a Laravel Nova project via Composer:# Install package composer require outl1ne/nova-sortableUsageCreate migrationAdd an order field to the model using Laravel migrations:// Add order column to the model Schema::table('some_model', function (Blueprint $table) { $table-...
On this migration, I get this error when rolling back: SQLSTATE[HY000]: General error: 1832 Cannot change column 'user_id': used in a foreign key constraint 'accountability_partners_user_id_foreign' (SQL: ALTER TABLE accountability_partners CHANGE us er_id user_id INT NOT NULL) <?php ...
The default primary ID column used in migrations will not work with UUID primary keys, as the default column type is an unsigned integer. UUIDs are 36 character strings so we must specify this in our migrations: <?phpuseIlluminate\Database\Migrations\Migration;useIlluminate\Database\Schema\Blue...
Hi guys, I encountered this issues with a migration rollback failing to remove a unique index (in my case, composed) if one of the columns used in it are also used in a foreign key constraint and, hence, in a automatically created index...
Only drop two_factor_confirmed_at column if it exists in the table … 146e4f9 crynobone closed this Jan 13, 2025 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Reviewers No reviews Assignees No one assigned Labels None yet Pr...
Install the package in a Laravel Nova project via Composer:# Install package composer require outl1ne/nova-sortableUsageCreate migrationAdd an order field to the model using Laravel migrations:// Add order column to the model Schema::table('some_model', function (Blueprint $table) { $table-...