Column properties

standard_default

Only accepts the value True, this property allows you to define that MakerMike will automatically set a value in case that the request to the create/update service does not include a value for the column with this property.

Default values

  • int: 0
  • bigint: 0
  • bit: 0
  • float: 0.0
  • double: 0.0
  • decimal: 0
  • numeric: 0
  • date: None
  • datetime: None
  • text: "" (empty string)
  • timestamp: None
  • json: {}
  • explicit json type/explicit json type with colors: [0]
  • reference: 1
  • reference with select property: [1]

Examples

Example with a column with implicit column text type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        standard_default: true

Example with a column with implicit JSON column type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        type:
        - option A
        - option B
        - option C
        standard_default: true

Example with a column type that references another table

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        type: _text_resource
        standard_default: true

default

This property allows you to define a desired value in case that the request to the create/update service does not include a value for the column with this property.

Examples

Example with a column with implicit column text type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        default: "my default value"

Example with a column with implicit JSON column type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        type:
        - option A
        - option B
        - option C
        default: [2]

Example with a column type that references another table

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        type: _text_resource
        default: [1]

Optional

This property allows you to define a column as optional, this means that you can set a null value for this column, this can be used for any column type.

When the table form is rendered the field of the column with this property won't have the attribute required.

Examples

Example with a column with implicit column text type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        optional: true

Example with a column with implicit JSON column type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        type:
        - option A
        - option B
        - option C
        optional: true

Example with a column type that references another table

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        type: _text_resource
        optional: true

Example with a column that references itself

In this case, with columns that reference the table that they belong, this property is automatically added after creating the project

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
        columns:
        - name
        - name: column1
            type: my_table

Example with tables with column types that reference each other

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
        columns:
        - name
        - name: column1
            type: my_table2
    - name: my_second_table
        columns:
        - name
        - name: column2
            type: my_table1

Select

Possible values [multi], this property can be combined only with the following column types:

  • JSON
  • explicit json type
  • explicit json type with colors
  • reference to other table

With this property, the column will let you choose multiple values for the column.

Examples

Example with column that references another table

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        select: multi
        type: _user
        - column2

Example with explicit json type

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        select: multi
        type:
            - value1
            - value2
            - value3
        - column2

Display

Only accepts the value html, this property allows you to see the string type column values of the column rendered as HTML code if they contain code in them.

Example

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    columns:
        - name: column1
        display: html
        - column2

Show

This property is the friendly column name, if not defined it will be automatically added by MakerMike when creating a project.

Example

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    show: "my table"
    columns:
        - column1

Allowed extensions

This property is meant to be used with the file column types, to make them accept only the desired file extension, if there is an attempt to upload a file with a different extension from the extensions specified in this property an error will be returned indicating the allowed extensions.

If the property is not specified, the default allowed extensions will be:

  • jpg
  • jpeg
  • gif
  • png
  • pdf
  • svg

Example

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
    - name: my_table
    show: "my table"
    columns:
        - employee
        - nme: profile_picture
        type: file
        allowed_extensions:
        - jpg
        - png

Unique

This property ensures that the values of the column(s) with this property will always be unique. This is validated when creating or updating a row.

The property accepts the following values: - True - true - "True" - "true" - Integer values up to 767 for the longtext and mediumtext column types. Since these column types are too large, only the n characters set by the integer value will be validated. This is due to the limitations of the InoDB storage engine. You can check more about it here.

The property is available for the following column types: - int - float - bit - decimal - double - bigint - text() - longtext - mediumtext - code(, ) - date - datetime - timestamp

Example

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        type: float
        unique: true

Example for the mediumtext or longtext columns:

name: my_project
show: my_project.com
time_zone: America/Mexico_City
tables:
  - name: my_table
    columns:
      - name: column1
        type: <mediumtext|longtext>
        unique: 200
Top