title | feature_name |
---|---|
Schema Editor |
SCHEMA_EDITOR |
Schema Editor provides a spreadsheet-like editor to view and edit database structure. Users first use the Schema Editor to prepare the schema changes, then those changes will be converted into SQL statements and go through the change workflow.
Schema Editor also supports the use of templates for fields and tables. Templates can be pre-defined at the workspace level and can be used to save time and ensure consistency when creating new schema entities. See Schema Template for more details.
By clicking on Alter Schema in the Quick Action panel and selecting the database, you will see the Schema Editor dialog.
To create a new table:
- Select a database and click the New Table on the top of the table list tab.
- Enter the table name.
- Add new column by clicking the Add Column on the top of column list tab.
- Specify the column's attributes: name, data type, default, comment, nullable, primary key and foreign key.
- Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.
To alter a table:
- Open the table editor tab by clicking the table list.
- Rename the table name by clicking the Rename dropdown item in table tree node.
- Add new column by clicking on the Add Column.
- Specify the new column's attributes: name, data type, default, comment, nullable, primary key and foreign key.
- Alter the existing column's attributes, if needed.
- Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.
To drop an existing table: