Create a table to extend the data model on Magnews and collect information related to contacts.
Create a data table from Settings > Developer > Data Tables
Click the New Table button
In the Name field of the new table, give a name to your table.
Once the name is entered, click the Add a primary key field button to create the primary key column.
Column name: assign a name to the column that will serve as the primary key.
The column name must start with a letter, accept only letters and numbers, and must be entirely lowercase.
Data type: choose the data type for the column.
You can choose Integer (4 bytes) or text. To relate the data from tables with the contacts, we suggest choosing the Integer value.
Autoincrement: automatically inserts values during the creation of records;
Sorting ascending orders the different records based on the value of the primary key (from smallest to largest).
Click the Save button.
Create field
To add all the other order-related information, click the New Field button for each column you want to add.
You will need to enter the following information:
- Name: name of the field you are creating;
-
Data type: choose which type of data to insert in the field:
-
Text:
used for names or small-sized text; -
Integer (4 Byte):
used for very large numbers (up to billions in value); -
Integer (1 Byte)
for checkbox values or very small numbers; -
Decimal number:
used for decimal numbers (for example, for prices); -
Long text:
it is possible to store very long texts, but it is recommended to use it only if strictly necessary as it has a high impact on table performance. -
Date:
allows you to enter date type values; -
Date and time field:
like the date field but with the possibility of specifying the time as well.
-
Text:
-
Unique constraint:
by selecting this option, the field values will be considered unique, in other words, there cannot be two rows with the same value in the same column.
This setting is usually used for identifying values or for email. -
Maximum character length:
the maximum number of characters that can be entered in this column. The maximum allowed length is 512 characters. -
Allows null values:
with this option, it is possible to insert the valueNull
that is no value in the column. -
Default value:
automatically associates the value entered in the field to the records for which none is defined during insertion.
In our case, create the field for the date and total order and contact