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