Skip to content

UInt32 mysql column error #409

@dmatamoroscr

Description

@dmatamoroscr

I'm getting this error when I try to set a column as an UInt32 with null: false
(using it in amber framework with mysql adapter, all in latest versions)

03:13:29 watch.run (Info) Building...
Showing last frame. Use --error-trace for full trace.

There was a problem expanding macro 'base_mapping'

Code in macro 'draw_mapping'

 3 | base_mapping(true)
     ^
Called macro defined in lib/jennifer/src/jennifer/model/mapping.cr:206:7

 206 | macro base_mapping(strict = true)

Which expanded to:

 > 505 |
 > 506 |               begin
 > 507 |                 __temp_221.as(UInt32)
                         ^
Error: can't cast Nil to UInt32

Relevant model mapping:

  mapping(
    id: Primary32,
    from_ip_num: {type: UInt32, null: false},
    to_ip_num: {type: UInt32, null: false},
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions