mirror of
https://github.com/ilyakooo0/reshape.git
synced 2024-11-22 09:14:21 +03:00
Add quotes for column names
This commit is contained in:
parent
80badccb55
commit
c8cd6f438e
@ -81,7 +81,7 @@ impl Action for AddColumn {
|
|||||||
let temp_column_name = self.temp_column_name(ctx);
|
let temp_column_name = self.temp_column_name(ctx);
|
||||||
|
|
||||||
let mut definition_parts = vec![
|
let mut definition_parts = vec![
|
||||||
temp_column_name.to_string(),
|
format!("\"{}\"", temp_column_name.to_string()),
|
||||||
self.column.data_type.to_string(),
|
self.column.data_type.to_string(),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ impl Action for AddColumn {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|column| {
|
.map(|column| {
|
||||||
format!(
|
format!(
|
||||||
"{alias} public.{table}.{real_name}%TYPE := NEW.{real_name};",
|
"\"{alias}\" public.{table}.{real_name}%TYPE := NEW.{real_name};",
|
||||||
table = table.real_name,
|
table = table.real_name,
|
||||||
alias = column.name,
|
alias = column.name,
|
||||||
real_name = column.real_name,
|
real_name = column.real_name,
|
||||||
@ -131,7 +131,7 @@ impl Action for AddColumn {
|
|||||||
DECLARE
|
DECLARE
|
||||||
{declarations}
|
{declarations}
|
||||||
BEGIN
|
BEGIN
|
||||||
NEW.{temp_column_name} = {up};
|
NEW."{temp_column_name}" = {up};
|
||||||
END;
|
END;
|
||||||
END IF;
|
END IF;
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
|
Loading…
Reference in New Issue
Block a user