Skip to content

Commit

Permalink
docs: default values (#986)
Browse files Browse the repository at this point in the history
* changes

* Changes

* changes
  • Loading branch information
asthamohta authored Jan 21, 2025
1 parent 85d34ba commit 46118a3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 6 additions & 2 deletions docs/data-types/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ and `ON UPDATE` actions, we drop them.

## Default Values

While Spanner supports default values, Spanner migration tool currently does not support translating source `DEFAULT` constraints to Spanner `DEFAULT` constraints. We drop the `DEFAULT` MySQL constraint during conversion.
It can be manually added to the DDL via an `ALTER TABLE` command.
The Spanner Migration Tool automatically migrates all `DEFAULT` values from a MySQL source
to a GoogleSQL destination, provided they can be mapped without modification.
Any `DEFAULT` constraints that cannot be mapped are dropped, and a warning is issued.
Users can edit the column to change the `DEFAULT` constraints. The validity of the `DEFAULT`
constraints will be verified when users try to move to the Prepare Migration page. In case
of any errors users will not be able to proceed until all `DEFAULT` constraints are valid.

## Check Constraints

Expand Down
8 changes: 6 additions & 2 deletions docs/data-types/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ Spanner doesn't support `ON DELETE` and `ON UPDATE` actions, so we drop these.

## Default Values

While Spanner supports default values, Spanner migration tool currently does not support translating source `DEFAULT` constraints to Spanner `DEFAULT` constraints. We drop the `DEFAULT` MySQL constraint during conversion.
It can be manually added to the DDL via an `ALTER TABLE` command.
The Spanner Migration Tool automatically migrates all `DEFAULT` values from a MySQL source
to a PostgreSQL destination, provided they can be mapped without modification.
Any `DEFAULT` constraints that cannot be mapped are dropped, and a warning is issued.
Users can edit the column to change the `DEFAULT` constraints. The validity of the `DEFAULT`
constraints will be verified when users try to move to the Prepare Migration page. In case
of any errors users will not be able to proceed until all `DEFAULT` constraints are valid.

## Secondary Indexes

Expand Down
2 changes: 2 additions & 0 deletions docs/ui/schema-conv/issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ Spanner migration tool scans through the generated spanner schema and notifies t
- Addition of [synthetic primary key](../ui.md/#termsterminology) - synth_id
- [Hotspotting](https://cloud.google.com/spanner/docs/schema-design) due to timestamp or auto-increment keys
- Auto Increment has been converted to Sequence, set Ignore Range or Start with Counter to avoid duplicate value errors
- Dropping unsupported default values during schema migration.

## Errors

- Detection of unsupported check constraints in spanner.
- Detection of invalid default values in spanner added during column modification.
- Data type mismatch of referenced column in check constraints.
- Referenced column in check constraints not found.
- Function referenced in check constraints is not found.
Expand Down
8 changes: 4 additions & 4 deletions docs/ui/schema-conv/spanner-draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ Users can view detailed information for a table by selecting it from the **Spann

### Column

Column tab provides information on the columns that are a part of the selected table. It also provides the option to edit the column wherein a user can modify a column name, delete a column, change the data type of the column, add auto-generation to the column or modify the null property of the column. Once the user is done with required modifications, they can click on **SAVE & CONVERT **and the update would reflect in the session file and across all the components in the database.
Column tab provides information on the columns that are a part of the selected table. It also provides the option to edit the column wherein a user can modify a column name, delete a column, change the data type of the column, add auto-generation to the column, modify the default value or modify the null property of the column. Once the user is done with required modifications, they can click on **SAVE & CONVERT **and the update would reflect in the session file and across all the components in the database.

![](https://services.google.com/fh/files/misc/column-info-edit.png)
![](https://services.google.com/fh/files/misc/dv1.png)

#### Add Column

In addition to editing the existing columns in the Spanner draft mapped from the source database, users can also add new columns to the selected table.

![](https://services.google.com/fh/files/misc/add_column.png)
![](https://services.google.com/fh/files/misc/dv4.png)
![](https://services.google.com/fh/files/misc/add_column_form.png)
![](https://services.google.com/fh/files/misc/new_column.png)
![](https://services.google.com/fh/files/misc/dvv3.png)

To specify custom transformation logic in the dataflow pipeline to populate these columns, please refer to the [Custom Transformation](../../transformations/CustomTransformation.md) section.

Expand Down

0 comments on commit 46118a3

Please sign in to comment.