safe_migrate/model/column.rs
1use crate::analysis::expr_ir::ExprIr;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct Column {
6 pub name: String,
7 pub data_type: Option<String>,
8 pub is_nullable: bool,
9 pub default: Option<ExprIr>,
10 pub avg_width: Option<i32>,
11 /// Raw default expression text from pg_get_expr(), unparsed.
12 /// Used for display and heuristic volatility checks without an ExprIr parser.
13 #[serde(default)]
14 pub default_expr_text: Option<String>,
15 /// Raw type modifier integer from pg_attribute.atttypmod.
16 /// Example: For VARCHAR(50), this stores 54 (50 + 4 length header).
17 #[serde(default)]
18 pub type_modifier: Option<i32>,
19}