opariltay / simple-desk-booking Goto Github PK
View Code? Open in Web Editor NEWEasy-to-use desk booking software which allows users to reserve a full-day seat at the workplace.
License: MIT License
Easy-to-use desk booking software which allows users to reserve a full-day seat at the workplace.
License: MIT License
Bug Description:
When attempting to create a migration for the personal_access_tokens
table in Laravel, a "Specified key was too long" error occurs. This error arises because Laravel tries to create an index with a key length that exceeds the maximum allowed by the database engine (MySQL), causing the migration to fail.
Fixed Code:
The issue can be resolved by adjusting the migration code to specify a custom index name with a shorter key length for the tokenable_type
column. Additionally, we explicitly define the tokenable_type
as a string with the desired length and tokenable_id
as an unsigned big integer. After defining the columns, we add the index separately to ensure it's created with the correct length.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePersonalAccessTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
// Use a smaller index key length
$table->string('tokenable_type', 191); // Adjust the length as needed
$table->unsignedBigInteger('tokenable_id');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
// Add an index separately
$table->index(['tokenable_type', 'tokenable_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.