Skip to content

Conversation

@circulon
Copy link
Contributor

@circulon circulon commented Dec 6, 2025

This fixes the issue where using an *increments() colum automatically assigned it as the primary key.
This aligns the *increments() with all other datatypes that can be used as a primary key or not.

There are several datatype tweaks for types that are not supported on that platform.
Notably on Sqlite AUTOINCREMENT is only supported for primary keys. So an exception is raised if .increments() is used on a column that is not markerd with .primary()

I added tests for creating the migrations as this is a common usage point for .increments() accross all platforms

Note: this is a breaking change for those developers using *incremenrs() as a primary key.
for this case just adding .primary() to the column definition will duplocate current behaviour.

@circulon circulon marked this pull request as draft December 6, 2025 02:11
As we are using CONSTRAINT for primary keys we dont need this identifier as well
*increments() data types mpw use column attributes instead of constraints to define the column as a primary key.
This standardises using *increments accross all platforms
as migrations table uses increments(“migration_id”).primary()
this is an ideal place to test the creation works correctly
@circulon circulon marked this pull request as ready for review December 9, 2025 02:11
@circulon
Copy link
Contributor Author

@josephmancuso @eaguad1337

Can you review this please or is there anything else we need to cover with this?

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.

1 participant