SQlite seems to ignore Unique Keys when there is a Primary Key.
This
share [mkPersist sqlSettings, mkSave "entityDefs"] [persistLowerCase|
Person
name String
creditcard Int
Primary name
UniqueA creditcard
|]
translates into
CREATE TABLE "person"("name" VARCHAR NOT NULL,"creditcard" INTEGER NOT NULL, PRIMARY KEY ("name"))
while after the fix
CREATE TABLE "person"("name" VARCHAR NOT NULL,"creditcard" INTEGER NOT NULL, PRIMARY KEY ("name"),CONSTRAINT "unique_a" UNIQUE ("creditcard"))
Before submitting your PR, check that you've:
- Bumped the version number
- Documented new APIs with Haddock markup
- Added
@sincedeclarations to the Haddock
After submitting your PR:
- Update the Changelog.md file with a link to your PR
- Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)