getDatabaseDefinition method

String getDatabaseDefinition(
  1. bool autoGenerate
)

The database column definition.

Implementation

String getDatabaseDefinition(final bool autoGenerate) {
  final columnSpecification = StringBuffer();

  if (autoGenerate) {
    columnSpecification.write(' PRIMARY KEY AUTOINCREMENT');
  }
  if (!isNullable) {
    columnSpecification.write(' NOT NULL');
  }

  return '`$columnName` $sqlType$columnSpecification';
}