Skip to main content

cratestack_sql/descriptor/
defaults.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum CreateDefaultType {
3    Bool,
4    Int,
5    BigInt,
6    String,
7}
8
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub struct CreateDefault {
11    pub column: &'static str,
12    pub auth_field: &'static str,
13    pub ty: CreateDefaultType,
14    pub nullable: bool,
15    /// Whether the auth field is required (non-optional) in the auth block.
16    /// When true, a missing auth field should cause validation to fail,
17    /// even if the model field is nullable. This prevents tenant-isolation
18    /// issues where NULL values bypass policy predicates.
19    pub auth_field_required: bool,
20}