Column constructor

const Column({
  1. bool primaryKey = false,
  2. ManagedPropertyType databaseType = ManagedPropertyType.integer,
  3. bool nullable = false,
  4. String defaultValue = '',
  5. bool unique = false,
  6. bool indexed = false,
  7. bool omitByDefault = false,
  8. bool autoincrement = false,
  9. List<Validate> validators = const [],
})

Creates an instance of this type.

defaultValue is sent as-is to the database, therefore, if the default value is the integer value 2, pass the string "2". If the default value is a string, it must also be wrapped in single quotes: "'defaultValue'".

Implementation

const Column(
    {bool primaryKey = false,
    ManagedPropertyType databaseType = ManagedPropertyType.integer,
    bool nullable = false,
    String defaultValue = '',
    bool unique = false,
    bool indexed = false,
    bool omitByDefault = false,
    bool autoincrement = false,
    List<Validate> validators = const []})
    : isPrimaryKey = primaryKey,
      databaseType = databaseType,
      isNullable = nullable,
      defaultValue = defaultValue,
      isUnique = unique,
      isIndexed = indexed,
      shouldOmitByDefault = omitByDefault,
      autoincrement = autoincrement,
      validators = validators;