addStr method

Create addStr(
  1. String name, {
  2. bool isNullable = false,
  3. int length = 20,
  4. bool primary = false,
  5. String? foreignTable,
  6. String? foreignCol,
  7. String? uniqueGroup,
})

Implementation

Create addStr(String name,
    {bool isNullable = false,
    int length = 20,
    bool primary = false,
    String? foreignTable,
    String? foreignCol,
    String? uniqueGroup}) {
  Foreign? foreign;
  if (foreignTable != null) {
    foreign = Foreign(foreignTable, foreignCol != null ? foreignCol : name);
  }
  _columns[name] = CreateStr(name,
      isNullable: isNullable,
      length: length,
      isPrimary: primary,
      foreignKey: foreign,
      uniqueGroup: uniqueGroup);
  return this;
}