adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.07k stars 191 forks source link

fix(migrator): set primary key for schema_versions table #957

Closed RomainLanz closed 1 year ago

RomainLanz commented 1 year ago

Hey! 👋🏻

This PR changes the definition of the adonis_schema_versions table to ensure a PRIMARY KEY is set.

In many DBMS, it is required to have a least one PRIMARY KEY. If you don't set one manually, the DBMS will try to figure out any indexes (UNIQUE), which may be used to act as the PRIMARY KEY. In this case, we had none.

Updated version of https://github.com/adonisjs/lucid/pull/945 for V6.