haskell-beam / haskell-beam/beam

Migrations: default_ not working for timestamp

Open
#313 9 comments 0 reactions 0 assignees View on GitHub
migration-framework
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

I have a migration defined with a field
```haskell
field "created" timestamp notNull (defaultTo_ currentTimestamp_)
```
But the default value is not added to the column when running the migration.
If I add the default value manually, the migration doesn't remove the default value. Seems like it is just being ignored.

So when running an insert using `default_` in the timestamp position we get
```
"null value in column \"created\" violates not-null constraint"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.