Skip to content

Specifying array types when generating migrations #301

Answered by futuretim
mateusdeap asked this question in Q&A
Discussion options

You must be logged in to vote

It sounds like you are having a similar issue I was having with floats. I couldn't find documentation on how to use them as the CLI registry/schema does not appear to offer that mapping when generating.

The same appears to be the case for Vec. However, if you just use underlying SeaORM logic you'll have no problem. So once you have a migration ready you can modify it. Let's say in the migration you generated you have a single integer value like so:

async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
        manager
            .create_table(
                table_auto(SomeModel::Table)
                   .col(integer(SomeModel::MyValue).borrow_mut())
                  .to_o…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mateusdeap
Comment options

@mateusdeap
Comment options

Answer selected by mateusdeap
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants