diff --git a/docs/README.md b/docs/README.md index c54c2261..2bea182b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -716,12 +716,15 @@ An add column operation creates a new column on an existing table. } ``` +Default values are subject to the usual rules for quoting SQL expressions. In particular, string literals should be surrounded with single quotes. + Example **add column** migrations: * [03_add_column.json](../examples/03_add_column.json) * [06_add_column_to_sql_table.json](../examples/06_add_column_to_sql_table.json) * [17_add_rating_column.json](../examples/17_add_rating_column.json) * [26_add_column_with_check_constraint.json](../examples/26_add_column_with_check_constraint.json) +* [30_add_column_simple_up.json](../examples/30_add_column_simple_up.json) ### Alter column @@ -924,6 +927,8 @@ where each `column` is defined as: }, ``` +Default values are subject to the usual rules for quoting SQL expressions. In particular, string literals should be surrounded with single quotes. + Example **create table** migrations: * [01_create_tables.json](../examples/01_create_tables.json) diff --git a/examples/30_add_column_simple_up.json b/examples/30_add_column_simple_up.json new file mode 100644 index 00000000..0e438b7f --- /dev/null +++ b/examples/30_add_column_simple_up.json @@ -0,0 +1,16 @@ +{ + "name": "30_add_column_simple_up", + "operations": [ + { + "add_column": { + "table": "people", + "up": "'temporary-description'", + "column": { + "name": "description", + "type": "varchar(255)", + "nullable": false + } + } + } + ] +}