SchemaColumn constructor

SchemaColumn(
  1. String name,
  2. Column columnType, {
  3. bool? autoincrement,
  4. dynamic defaultValue,
  5. bool isPrimaryKey = false,
  6. bool isForeignKey = false,
  7. String? foreignTableName,
  8. bool? nullable,
  9. bool onDeleteCascade = false,
  10. bool onDeleteSetDefault = false,
  11. bool? unique,
})

Implementation

SchemaColumn(
  this.name,
  this.columnType, {
  bool? autoincrement,
  this.defaultValue,
  this.isPrimaryKey = false,
  this.isForeignKey = false,
  this.foreignTableName,
  bool? nullable,
  this.onDeleteCascade = false,
  this.onDeleteSetDefault = false,
  bool? unique,
})  : autoincrement = autoincrement ?? InsertColumn.defaults.autoincrement,
      nullable = nullable ?? InsertColumn.defaults.nullable,
      unique = unique ?? InsertColumn.defaults.unique,
      assert(!isPrimaryKey || columnType == Column.integer, 'Primary key must be an integer'),
      assert(!isForeignKey || (foreignTableName != null));