/

Column Attributes

Specifying additional attributes on columns


SchemaHero supports creating and editing additional column attributes on database table columns.

auto_increment

In MySQL, it is possible to add the AUTO_INCREMENT attribute to integer types to generate a unique identity for new rows.

In Postgresql and Cockroachdb, it is more common to use the serial type.

apiVersion: schemas.schemahero.io/v1alpha4
kind: Table
metadata:
  name: users
spec:
  database: my-database
  name: users
  schema:
    postgres:
      primaryKey: [id]
      columns:
        - name: id
          type: integer
          attributes:
            autoIncrement: true
Edit on GitHub