microsandbox_db/entity/volume.rs
1//! Entity definition for the `volumes` table.
2
3use sea_orm::entity::prelude::*;
4
5//--------------------------------------------------------------------------------------------------
6// Types
7//--------------------------------------------------------------------------------------------------
8
9/// The volume entity model.
10#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
11#[sea_orm(table_name = "volume")]
12pub struct Model {
13 #[sea_orm(primary_key)]
14 pub id: i32,
15 #[sea_orm(unique)]
16 pub name: String,
17 pub kind: String,
18 pub quota_mib: Option<i32>,
19 pub size_bytes: Option<i64>,
20 pub capacity_bytes: Option<i64>,
21 pub disk_format: Option<String>,
22 pub disk_fstype: Option<String>,
23 pub labels: Option<String>,
24 pub created_at: Option<DateTime>,
25 pub updated_at: Option<DateTime>,
26}
27
28//--------------------------------------------------------------------------------------------------
29// Types: Relations
30//--------------------------------------------------------------------------------------------------
31
32/// Relations for the volume entity.
33#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
34pub enum Relation {}
35
36//--------------------------------------------------------------------------------------------------
37// Trait Implementations
38//--------------------------------------------------------------------------------------------------
39
40impl ActiveModelBehavior for ActiveModel {}