haskell-beam / haskell-beam/beam
Sqlite migration fails with "default value of column is not constant"
- Dominant language
- Haskell
- Stars
- 635
- Forks
- 193
- PR merge metrics
- No merged PRs in 30d
Description
I'm finding that Sqlite migrations that use the `defaultTo_` function don't work. I think it's because they try to use a wildcard to insert the default value.
I made a full repro here: https://github.com/thomasjm/beam-sqlite-default-repro
Here's what happens when you run it (formatted slightly for readability):
```
CREATE TABLE "repro"("id" INTEGER PRIMARY KEY AUTOINCREMENT,
"ref_count" INTEGER DEFAULT (?) NOT NULL );
-- With values: [SQLInteger 0]
beam-sqlite-default-repro-exe: SQLite3 returned ErrorError while attempting to perform prepare
"CREATE TABLE \"repro\"(\"id\" INTEGER PRIMARY KEY AUTOINCREMENT,
\"ref_count\" INTEGER DEFAULT (?) NOT NULL )":
default value of column [ref_count] is not constant
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.