Change Database /

Schema Editor

!

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.

schema-editor-dialog

Create table

To create a new table:

  1. Select a database and click the New Table on the top of the table list tab. create-table-button
  2. Enter the table name.
  3. Add new column by clicking the Add Column on the top of column list tab. add-column-button
  4. Specify the column's attributes: name, data type, default, comment, nullable, primary key and foreign key.
  5. Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.

Alter table

To alter a table:

  1. Open the table editor tab by clicking the table list.
  2. Rename the table name by clicking the Rename dropdown item in table tree node. table-rename-button
  3. Add new column by clicking on the Add Column.
  4. Specify the new column's attributes: name, data type, default, comment, nullable, primary key and foreign key.
  5. Alter the existing column's attributes, if needed.
  6. Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.

Drop table

To drop an existing table:

  1. Hover to the table and click the Drop Table dropdown item, or the Trash button for the table row. drop-table-button
  2. Click Preview Issue, then Bytebase will go to the issue creating page with the generated SQL statement.