Skip to main content

microsandbox_migration/
lib.rs

1//! Database migrations for microsandbox.
2
3mod m20260305_000001_create_image_tables;
4mod m20260305_000002_create_sandbox_tables;
5mod m20260305_000003_create_storage_tables;
6mod m20260305_000004_create_sandbox_images_table;
7mod m20260410_000001_erofs_image_schema;
8mod m20260501_000001_create_snapshot_index;
9mod m20260517_000001_drop_sandbox_metric;
10mod m20260527_000001_migrate_oci_rootfs_source;
11mod m20260531_000001_create_sandbox_labels;
12mod m20260531_000002_index_sandbox_labels_key_value;
13
14use sea_orm_migration::prelude::*;
15
16//--------------------------------------------------------------------------------------------------
17// Re-Exports
18//--------------------------------------------------------------------------------------------------
19
20pub use sea_orm_migration::MigratorTrait;
21
22//--------------------------------------------------------------------------------------------------
23// Types
24//--------------------------------------------------------------------------------------------------
25
26/// The migrator that runs all migrations in order.
27pub struct Migrator;
28
29//--------------------------------------------------------------------------------------------------
30// Trait Implementations
31//--------------------------------------------------------------------------------------------------
32
33#[async_trait::async_trait]
34impl MigratorTrait for Migrator {
35    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
36        vec![
37            Box::new(m20260305_000001_create_image_tables::Migration),
38            Box::new(m20260305_000002_create_sandbox_tables::Migration),
39            Box::new(m20260305_000003_create_storage_tables::Migration),
40            Box::new(m20260305_000004_create_sandbox_images_table::Migration),
41            Box::new(m20260410_000001_erofs_image_schema::Migration),
42            Box::new(m20260501_000001_create_snapshot_index::Migration),
43            Box::new(m20260517_000001_drop_sandbox_metric::Migration),
44            Box::new(m20260527_000001_migrate_oci_rootfs_source::Migration),
45            Box::new(m20260531_000001_create_sandbox_labels::Migration),
46            Box::new(m20260531_000002_index_sandbox_labels_key_value::Migration),
47        ]
48    }
49}