Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Migration fails with too-long index name #46

Open
vvval opened this issue Jul 21, 2020 · 0 comments
Open

Migration fails with too-long index name #46

vvval opened this issue Jul 21, 2020 · 0 comments
Assignees

Comments

@vvval
Copy link
Contributor

vvval commented Jul 21, 2020

    public function up(): void
    {
        $this->table('long_table_name')
            ->addForeignKey(
                ['column'],
                'foreign_table',
                ['id'],
                ['name'   => 'long_table_name_column_hash', /* etc */]
            )
    }

[Spiral\Migrations\Exception\MigrationException]
Error in the migration (migration name) occurred: SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'long_table_name_column_hash' is too long in /var/www/vendor/spiral/migrations/src/Migrator.php:173

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants