Schema Editor
Manually editing project Schema
To do that, go to the project Schema tab where you can change the project, add and remove entities, and rebuild the project. Here is a video example how to modify schema of your app.
The basic essence of the Schema Editor is that it consists of tables and columns, and your work will consist of working with them.
When working with tables, you have 2 options - add a new table or delete it (any except the default Users table). Now let's take a look at each of these steps separately.
When working with columns, you have 3 options - add or remove a column, or change the properties of the column.
Working with tables
- Adding the table: to add a table you need to press the '+ Add Table' button (see screenshot below). After clicking the button, a new table will be added and you will be prompted to select a name for this table. Please follow SQL table naming standards. Please choose the name in lower case for better code generation. You can add an unlimited number of tables to the paid plan and the free plan. For example, users, categories, tags, tags1, tags2, etc.
- Deleting the table: deleting a table is very simple - you just need to select the table you want to delete and click the 'Delete Table' button. The table and all columns referring to it will be deleted immediately. Please note that the ‘Users’ table can not be deleted.
Working with columns
- Adding a Column. To create a new column, start by selecting the table where the column will be added. Next, click the
+ Add Column
button. This action will open the Edit Column window on the right side of the screen, allowing you to configure the following parameters.:
Note: Our generator adds the column ID itself and makes the connection if necessary: you don't need to add the column ID yourself.
Name | SQL column name and code property. Use snake or camel case. Note, the column name cannot start with a number. | Name, Title, Name1 |
Title | Property visible name in user interface | Role, Avatar |
Type | Column type | string, integer |
The following types are offered to choose from:
Name | Decription | Examples |
---|---|---|
String | stores text data | Hello World! |
Boolean | stores true/false | true |
Date time | stores full date only with time | 2022-02-22M09:45:27 |
Date | stores full date only, without time | 2022-02-22M |
Decimal | stores fraction | 22.75 |
Integer | stores integers | 45 |
Enumeration | stores any value from specified list | 1 , 2 , 3 |
Images | stores image files | link |
Files | stores any raw files | link |
Relation (one) | one-sided relation capable of storing one of other entity | Employee: [{ name: 'John'}] |
Relation (many) | two-sided relation capable of storing any number of other entity | Employee: [{ name: 'John' }, { name: 'Joe' }] ; |
- Editing a Column. To edit an existing column, simply click on it. The Edit Column menu will appear on the right side of the modal window, displaying the properties available for modification. You can update the following properties: Name, Title, Show in Form, Show in Table. When naming columns, please use camelCase, numbers, and underscores (
_
) for consistency and clarity.
Note: The column name cannot start with a number. Also, there cannot be the same-named columns in one table.
- Deleting a column: Deleting a column is done by selecting the column you want to delete and pressing the Delete button. The column should be deleted immediately. You cannot delete the last column in the table.
Saving changes to Development environment
After you made your changes to the schema at the Schema Editor tab, you need to save your changes on your Development environment by clicking on Save button.
Next, the Flatlogic Platform creates a new version at your Development environment for you.
Note that depending on your template type (free community template or paid template), pushing to GitHub may require credits. For paid templates, you'll need to activate the "Push to GitHub" feature for your project, which is a one-time credit cost that unlocks source code access.
Deployment
Next, go back to your Overview tab and click on “Deploy”. This will regenerate your application. More details about deployment you can check by this page: Deploying Your App
Versioning and Rollbacks
Every change made by the AI Engineer could be saved manually. It creates a new version in your Development environment. This gives you complete freedom to experiment with your application, knowing you can always return to a previous working version, compare changes between versions and select successful changes while discarding others.
If you face any difficulties, please message us on our Discord, Forum, Twitter, or Facebook. We will respond to your inquiry as quickly as possible!