Modifying Schemas
This topic provides instructions for adding, editing, and deleting schema tables.
- Opening Schemas
- Adding a Table to a Schema
- Adding a Table Query to a Schema
- Deleting a Table from a Schema
- Changing a Schema Table
Note: Before modifying a schema, you have the option to create a backup of the current version. For more information, see Creating and Restoring Versions.
Opening Schemas
In the Anzo console, expand the Onboard menu and click Structured Data. Then click the Schemas tab. Anzo displays the Data Source Metadata screen. For example:
On the Data Source Metadata screen, click the name of the schema that you want to edit. Anzo displays the Schema Overview screen. Click the Tables tab to view the schema tables. For example:
The schema tables are listed on the left side of the screen.
Click a table to view the table's details in the middle of the screen.
Adding a Table to a Schema
To add a table, type the name in the New Table Name Here field and then click the plus (+) icon next to the field. The new table appears in the list above the field.
Adding a Table Query to a Schema
Follow the instructions below to write a query that adds a table to a schema.
- In the Anzo console, expand the Onboard menu and click Structured Data.
- On the Data Sources screen select the data source with the schema that you want to edit. Anzo displays the details for the data source.
- Click the Schema tab. Anzo displays the list of schemas for the data source. For example:
- Click the ellipses () for the schema that you want to change and select Add Table. Anzo displays the Create New Table dialog box.
- Type a name for the new table in the Table Name field, and then type the SQL query in the Query text box. The statement can include any functionality that the source database supports.
- Click Save to save the table query and close the dialog box.
- To reload the schema and add the new table, click the ellipses () for the schema and select Reload.
Deleting a Table from a Schema
To delete a table, hover your pointer over the table name, and then click the trashcan icon () next to the name.
Changing a Schema Table
To modify a table such as to add a comment, change the table's name or a column's name or data type, add or remove columns, or change the primary key, follow the instructions below, depending on what you want to do:
- Change a Table's Name
- Add a Column to a Table
- Delete a Column from a Table
- Change an Existing Column
Change a Table's Name
- On the Tables screen, select the radio button for the table that you want to edit in the table list. Anzo displays the table details in the center of the screen.
- Click the edit button () next to the table name. Anzo makes the Name field editable.
- Type the new name and then click the check mark icon () to save the change.
Add a Column to a Table
- On the Tables screen, select the radio button for the table that you want to edit in the table list. Anzo displays the table details in the center of the screen.
- Click the Add Column button () on the right side of the screen. Anzo opens the Create dialog box.
- Type a name for the new column in the Name field.
- Click the Semantic Type drop-down list and select the column's semantic type.
- If the new column is a primary key, select the Primary Key check box. If the column is not a primary key, leave the Primary Key option blank.
- Click Save to add the new column to the table.
Delete a Column from a Table
- On the Tables screen, select the radio button for the table that you want to edit in the table list. Anzo displays the table details in the center of the screen.
- In the row for the column that you want to delete, click the vertical ellipses () and select Delete. Anzo deletes the column from the table. You cannot undo the deletion.
Change an Existing Column
- On the Tables screen, select the radio button for the table that you want to edit in the table list. Anzo displays the table details in the center of the screen.
- In the row for the column that you want to change, click the vertical ellipses () and select Edit. Anzo opens the Edit dialog box. For example:
- Change the column's name, data type, or primary key designation as needed, and then click Save.
Note: The existing primary key for the table is indicated with the black key icon () in the left column on the table details page.