1use serde::{Deserialize, Serialize};
10
11use super::{ColumnType, Expr};
12
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct CreateDomain {
15 pub name: String,
16 pub base: ColumnType,
17 pub collation: Option<String>,
18 pub default: Option<Expr>,
19 pub not_null: Option<DomainNotNull>,
20 pub checks: Vec<DomainCheck>,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct DomainNotNull {
25 pub name: Option<String>,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize)]
29pub struct DomainCheck {
30 pub name: Option<String>,
31 pub expression: Expr,
32}