Create a Table in the Data Store
Next, let's create a table in the Data Store in the ZCDrive project. This table stores the metadata of the files that are uploaded in the Android app.
To create a table:
- Navigate to Data Store under Develop.
- Click Create a new Table.
- Enter the table's name as "Files" and click Create.Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.
We will create four columns in this table to store the file ID, name, type, and the uploaded time of the file.
- Click New Column in the Schema View section for the table.
- Enter the column's name as "file_id". Select the data type as Var Char and enter the max length as 100. You must enable the Is Mandatory toggle.
You can learn about the various data types supported by Catalyst and the other properties of a column from the Data Store help page.Note: Ensure that you enter the name exactly as instructed, because the application's code contains the same name.
- Click Create.
Create the other columns in the same way with the values shown in the images:
All columns will be created and listed in the Schema View section.
The Data Store is now configured for the app.
Each time you upload a file in the app, a row will get created for it in the Files table. When you delete a file, its data row will also be deleted from the table automatically.