Skip to content

[DB migrations] Consider inserting data after DB migrations not during DB migration #297

@jonastheis

Description

@jonastheis

The SeaORM migrations and specifically the MigratorTrait are statically typed. By default, the framework doesn't allow for passing dynamic data to the individual migrations.

Currently, this is solved via static types returning constant data via the MigrationInfo trait. However, this is very limiting as all data needs to be known at compile time.

In the context of implementing #250 this became a problem: the genesis hash is not constant but it is dynamic depending on the ChainSpec which is read at runtime during node startup.

For now this is solved by overriding the genesis hash after the migrations ran. But overall we should reconsider how we populate data into the DB as the current mechanism is already reaching its limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions