hoprd_migration/
lib.rs

1pub use sea_orm_migration::prelude::*;
2
3mod m20240814_000001_metadata_create_db;
4
5pub struct Migrator;
6
7/// Used to instantiate all tables to generate the corresponding entities in
8/// a non-SQLite database (such as Postgres).
9#[async_trait::async_trait]
10impl MigratorTrait for Migrator {
11    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
12        vec![Box::new(m20240814_000001_metadata_create_db::Migration)]
13    }
14}
15
16/// SQLite does not allow writing lock tables only, and the write lock
17/// will apply to the entire database file. It is therefore beneficial
18/// to separate the exclusive concurrently accessing components into
19/// separate database files to benefit from multiple write locks over
20/// different parts of the database.
21pub struct MigratorMetadata;
22
23#[async_trait::async_trait]
24impl MigratorTrait for MigratorMetadata {
25    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
26        vec![Box::new(m20240814_000001_metadata_create_db::Migration)]
27    }
28}