validateIntegrity method

  1. @override
VerificationContext validateIntegrity(
  1. Insertable<SkippedVersionRow> instance, {
  2. bool isInserting = false,
})
override

Validates that the given entity can be inserted into this table, meaning that it respects all constraints (nullability, text length, etc.).

Implementation

@override
VerificationContext validateIntegrity(Insertable<SkippedVersionRow> instance,
    {bool isInserting = false}) {
  final context = VerificationContext();
  final data = instance.toColumns(true);
  if (data.containsKey('id')) {
    context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
  }
  if (data.containsKey('skipped')) {
    context.handle(_skippedMeta,
        skipped.isAcceptableOrUnknown(data['skipped']!, _skippedMeta));
  } else if (isInserting) {
    context.missing(_skippedMeta);
  }
  return context;
}