Editing Application
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.
Pushing changes to GitHub
After you made your changes to the schema at the Schema Editor tab, you need to push your changes to your GitHub repository by clicking on Push to GitHub button or Push changes.
Next, the Flatlogic Bot creates a new commit at your GitHub repository for you and uploads your new code there. This commit will contain all required changes and new classes for created entities and main changes.
Here is a video example of How to deploy updates to the cloud.
There are two branches: master & generated. Master - is for you to make changes directly in the source code. Generated is for Flatlogic Bot to make changes to the generated code.
All changes that you’ve done at the Schema Editor tab will commit to the Generated branch. After this you need to create a pull request and merge Generated branch into the Master.
You need to click on ‘Compare & Pull request’.
Deployment
Next, go back to your project page, go to the Settings tab and click on “Deploy”. This will regenerate your application. When you press any Deploy button, the code will be taken from the GitHub. This means that if there is a GitHub connected, the code will always be taken from there.