Skip to content

[Bug]: Error Installing Tastyigniter 4.0.0: Database Index Name Too Long #1111

@pinalgirkar

Description

@pinalgirkar

What happened?

I was attempting to install Tastyigniter 4.0.0 on AlmaLinux 8.10 using the following CLI command, with the system requirements being Apache 2.2, PHP 8.3, and MySQL 8.0.

composer create-project tastyigniter/tastyigniter:^v4.0 tastyigniter

Once the package was downloaded, I began the setup process with this command:
php artisan igniter:install

After entering the database details, I encountered the following error:

igniter.api::2020_05_18_000300_create_access_tokens_table ..... 24.03ms FAIL

Illuminate\Database\QueryException

SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'preta_igniter_api_access_tokens_tokenable_type_tokenable_id_index' is too long (Connection: mysql, SQL: alter table `preta_igniter_api_access_tokens` add index `preta_igniter_api_access_tokens_tokenable_type_tokenable_id_index`(`tokenable_type`, `tokenable_id`))

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822▕                 );
    823▕             }
    824▕
  ➜ 825▕             throw new QueryException(
    826▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827▕             );
    828▕         }
    829▕     }

+46 vendor frames

47  artisan:35
    Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

It seems that the error is caused by the length of the index name, preta_igniter_api_access_tokens_tokenable_type_tokenable_id_index, which exceeds the maximum allowed length for index names in MySQL.

Can you please check this and fix it.

Regards

What did you expect to happen?

It should install properly without any error.

laravel.log

Version

Other (please detail)

What browser are you seeing the problem on?

No response

Relevant log output

igniter.api::2020_05_18_000300_create_access_tokens_table ..... 24.03ms FAIL

Illuminate\Database\QueryException

SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'preta_igniter_api_access_tokens_tokenable_type_tokenable_id_index' is too long (Connection: mysql, SQL: alter table `preta_igniter_api_access_tokens` add index `preta_igniter_api_access_tokens_tokenable_type_tokenable_id_index`(`tokenable_type`, `tokenable_id`))

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822▕                 );
    823▕             }
    824▕
  ➜ 825▕             throw new QueryException(
    826▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827▕             );
    828▕         }
    829▕     }

+46 vendor frames

47  artisan:35
    Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions