Schema Editor
warning
This feature is in beta and only available for MySQL and PostgreSQL.
Schema Editor for MySQL currently supports editing Table
and Column
objects.
Schema Editor for PostgreSQL currently supports editing Schema
, Table
and Column
objects.
Bytebase's 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.
How to use
By clicking on Alter Schema in the Quick Action panel and selecting the database, you will see the Schema Editor dialog.
Create table
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.
Alter table
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.
Drop table
To drop an existing table:
- Hover to the table and click the Drop Table dropdown item, or the Trash button for the table row.
- Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.