Create Table

Create Table

The first step when working with StackPuz is create the table.

You can create the table by right click on the Tables icon and choose "Add Table".

Create Table

Table Structure

The Table Structure tab will let you design the table by Add, Edit, Delete or Reorder the table's column. Define the attributes of the column includes:

  • Name The column name
  • Data Type the column data type
  • Length The maximum length of the value
  • Key The column PRIMARY KEY
  • Unique The column will have the UNIQUE constraint
  • Required The column will have the NOT NULL constraint
  • Auto Increment The column will use AUTO INCREMENT (generate the unique number automatically)
  • Default The default value of the column

If you have some experience with the database design and development, You should working with this screen without encountering any issues.

Table Structure

Audit Columns

The audit columns will help you tracking changes to row data. Consists of these information:

  • Who create the row.
  • When was the row created.
  • Who update the row.
  • When was the row updated.

It is optional. You can use it all or just some of it or even not using it. It is up to your requirements.

Note

The audit columns is the System Column that the value of these columns will manage by the system, so you can't use its as the input element in the View.

You can add the audit columns by click on "Add Audit Columns" button.

Audit Columns

You can also change each audit column name in the Database Settings tab of the project.

Audit Column Name

Test Data

Test Data is one of useful feature in StackPuz. It can save you time and effort by automatically generating the test data with various attributes.

You can use the Data Setting column to config the test data of the table by select the kind of data value or setting about how the data generated.

Test Data Setting

SQL Script

SQL Script is the SQL generator to help you create the table (DDL) or import the test data to the database quickly.

You can click on the "Copy" icon to copy the generated SQL and paste it to any Database Client software and RUN this SQL later.

SQL Script

Note

SQL Script also available on the Target section of the project. In this section it will generate SQL for all tables in the project, so you can use this script to create all tables or import all the test data to the database in one click!

SQL Script