Custom `sqltype=` for PK field with `Primary` isn't respected while TH parsing
まだ誰も着手していません。
評価
調査の方向性
Start in Database.Persist.TH.Internal and trace how the schema example is parsed into FieldDef for the SurrogateKey branch. Reproduce the failure with the persistent-mysql or persistent-mysql-haskell test suite and inspect the generated ItemSize migration. Done when the custom sqltype=varchar(80) is preserved for the primary-key field and the migration succeeds.
索引モデルが issue の本文から書いたものです。
説明
I have recently discovered that test-suite of persistent-mysql-haskell (as well as persistent-mysql) is failing for the following schema:
share
[mkPersist sqlSettings, mkMigrate "duplicateMigrate"]
[persistUpperCase|
Item
name Text sqltype=varchar(80)
description Text
price Double Maybe
quantity Int Maybe
Primary name
deriving Eq Show Ord
ItemSize
Id (Key Item) sqltype=varchar(80)
size Int
deriving Eq Show Ord
|]
During tests while executing migration, it produces following script and error message:
CREATe TABLE `ItemSize`(`id` TEXT NOT NULL PRIMARY KEY,`size` BIGINT NOT NULL);
Migrating: CREATe TABLE `ItemSize`(`id` TEXT NOT NULL PRIMARY KEY,`size` BIGINT NOT NULL)
test: ConnectionError {errFunction = "query", errNumber = 1170, errMessage = "BLOB/TEXT column 'id' used in key specification without a key length"}
Test suite test: FAIL
Of course, migration script generator (with its CREATe) belongs to persistent-mysql, yet FieldDef of table columns is being parsed via persistent (core). And it turned out that custom sqltype is omitted there for SurrogateKey branch in Database.Persist.TH.Internal module.
- 主要言語
- Haskell
- スター
- 486
- フォーク
- 307
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
yesodweb/persistent のほかの issue
-
use aeson >= 2.3.0.0 to avoid HSEC-2026-0007対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
yesodweb/persistent#1635 · コメント 1 件 · リアクション 1 件 ·
-
Typos in Documentation for Database.Persist.Quasi対応中かも @000wahab000 が 64 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
yesodweb/persistent#1634 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
yesodweb/persistent#1643 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
yesodweb/persistent#1641 ·
-
Regression since bumping resource-pool from `0.4.0.0` to `0.5.x`対応中かも @swamp-agr が 74 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
yesodweb/persistent#1636 ·
yesodweb/persistent の issue をすべて見る
似ている issue
-
bug dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
alunduil/network-arbitrary#251 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
haskell/statistics#235 ·
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
pkg:crucible-mir type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100