1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::common::{DataType, Identifier};
use std::fmt::{Display, Formatter};

/// data to alter a column type.
#[derive(PartialEq, Debug, Clone)]
pub struct AlterColumnType {
    /// the name of the column
    pub name: Identifier,
    /// the data type to set the colum to.
    pub data_type: DataType,
}

impl Display for AlterColumnType {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "ALTER {} TYPE {}", self.name, self.data_type)
    }
}