Skip to content

Conversation

ghostwriter
Copy link
Contributor

If applied, this pull request will:

  • change the dataType of an id column from increments to bigIncrements ensuring relationships created with unsignedBigInteger (UNSIGNED BIGINT equivalent column) matches the dataType of an id column (Auto-incrementing UNSIGNED BIGINT ).
  • update all the current test fixtures
Column Types Description
increments Auto-incrementing UNSIGNED INTEGER (primary key) equivalent column.
bigIncrements Auto-incrementing UNSIGNED BIGINT (primary key) equivalent column.
unsignedBigInteger UNSIGNED BIGINT equivalent column.

@jasonmccreary
Copy link
Collaborator

Nice. Can't believe this wasn't noticed earlier.

Ultimately I want to use the new id shorthand built-in to Laravel. But I'm going to support 5.8 a bit longer.

@jasonmccreary jasonmccreary merged commit 076f226 into laravel-shift:master Jan 11, 2020
@msonowal
Copy link

@nathane @jasonmccreary ,
But now there is no option to have a column name id with normal increments as it always takes bigIncrements which is a issue

@jasonmccreary
Copy link
Collaborator

@msonowal, not sure your goal, but you can create a column named id as an increments column explicity.

For example:

models:
    User:
        id: increments

If that doesn't work, please open an issue.

@msonowal
Copy link

@jasonmccreary it does not work that is why at first I have created the issue and opened a PR #107

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

Successfully merging this pull request may close these issues.

3 participants