Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration fails when point column gets a SRID and "after" is used #31543

Closed
halloei opened this issue Feb 20, 2020 · 1 comment
Closed

Migration fails when point column gets a SRID and "after" is used #31543

halloei opened this issue Feb 20, 2020 · 1 comment
Labels

Comments

@halloei
Copy link
Contributor

halloei commented Feb 20, 2020

  • Laravel Version: 6.16.0
  • PHP Version: 7.2.17
  • Database Driver & Version: MySQL 8.0.16

Description:

The SQL statement is built incorrectly when a point column should be added with a SRID and after another column.

Actual SQL:
alter table `test` add `location` point not null after `id` srid 4326;
Correct SQL:
alter table `test` add `location` point not null srid 4326 after `id`;

The error message:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'srid 4326' at line 1 (SQL: alter table test add location point not null after id srid 4326)

Steps To Reproduce:

Schema::create('test', function (Blueprint $table) {
    $table->bigIncrements('id');
});
        
Schema::table('test', function (Blueprint $table) {
    $table->point('location', 4326)->after('id');
});
@driesvints driesvints added the bug label Feb 20, 2020
@driesvints
Copy link
Member

This indeed seems problematic. I'm not sure if this is related to DBAL or to our own Schema. Appreciating help with figuring this out.

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

No branches or pull requests

2 participants