mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 08:43:00 +00:00
chore: rename change to modify (#5000)
* chore: rename change to modify * chore: proto rev
This commit is contained in:
@@ -170,7 +170,7 @@ impl ParserContext<'_> {
|
||||
self.parse_alter_column_fulltext(column_name)
|
||||
} else {
|
||||
let data_type = self.parser.parse_data_type().context(error::SyntaxSnafu)?;
|
||||
Ok(AlterTableOperation::ChangeColumnType {
|
||||
Ok(AlterTableOperation::ModifyColumnType {
|
||||
column_name,
|
||||
target_type: data_type,
|
||||
})
|
||||
@@ -399,7 +399,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_alter_change_column_type() {
|
||||
fn test_parse_alter_modify_column_type() {
|
||||
let sql_1 = "ALTER TABLE my_metric_1 MODIFY COLUMN a STRING";
|
||||
let result_1 = ParserContext::create_with_dialect(
|
||||
sql_1,
|
||||
@@ -427,10 +427,10 @@ mod tests {
|
||||
let alter_operation = alter_table.alter_operation();
|
||||
assert_matches!(
|
||||
alter_operation,
|
||||
AlterTableOperation::ChangeColumnType { .. }
|
||||
AlterTableOperation::ModifyColumnType { .. }
|
||||
);
|
||||
match alter_operation {
|
||||
AlterTableOperation::ChangeColumnType {
|
||||
AlterTableOperation::ModifyColumnType {
|
||||
column_name,
|
||||
target_type,
|
||||
} => {
|
||||
@@ -461,10 +461,10 @@ mod tests {
|
||||
let alter_operation = alter_table.alter_operation();
|
||||
assert_matches!(
|
||||
alter_operation,
|
||||
AlterTableOperation::ChangeColumnType { .. }
|
||||
AlterTableOperation::ModifyColumnType { .. }
|
||||
);
|
||||
match alter_operation {
|
||||
AlterTableOperation::ChangeColumnType {
|
||||
AlterTableOperation::ModifyColumnType {
|
||||
column_name,
|
||||
target_type,
|
||||
} => {
|
||||
@@ -492,10 +492,10 @@ mod tests {
|
||||
let alter_operation = alter_table.alter_operation();
|
||||
assert_matches!(
|
||||
alter_operation,
|
||||
AlterTableOperation::ChangeColumnType { .. }
|
||||
AlterTableOperation::ModifyColumnType { .. }
|
||||
);
|
||||
match alter_operation {
|
||||
AlterTableOperation::ChangeColumnType {
|
||||
AlterTableOperation::ModifyColumnType {
|
||||
column_name,
|
||||
target_type,
|
||||
} => {
|
||||
|
||||
@@ -66,7 +66,7 @@ pub enum AlterTableOperation {
|
||||
location: Option<AddColumnLocation>,
|
||||
},
|
||||
/// `MODIFY <column_name> [target_type]`
|
||||
ChangeColumnType {
|
||||
ModifyColumnType {
|
||||
column_name: Ident,
|
||||
target_type: DataType,
|
||||
},
|
||||
@@ -101,7 +101,7 @@ impl Display for AlterTableOperation {
|
||||
AlterTableOperation::RenameTable { new_table_name } => {
|
||||
write!(f, r#"RENAME {new_table_name}"#)
|
||||
}
|
||||
AlterTableOperation::ChangeColumnType {
|
||||
AlterTableOperation::ModifyColumnType {
|
||||
column_name,
|
||||
target_type,
|
||||
} => {
|
||||
|
||||
@@ -53,7 +53,7 @@ impl TransformRule for TypeAliasTransformRule {
|
||||
.for_each(|column| replace_type_alias(column.mut_data_type()));
|
||||
}
|
||||
Statement::Alter(alter_table) => {
|
||||
if let AlterTableOperation::ChangeColumnType { target_type, .. } =
|
||||
if let AlterTableOperation::ModifyColumnType { target_type, .. } =
|
||||
alter_table.alter_operation_mut()
|
||||
{
|
||||
replace_type_alias(target_type)
|
||||
|
||||
Reference in New Issue
Block a user