SchemaDiffKind

Ecng.Serialization

Describes a difference between entity schema and database schema.

Поля

ColumnNameCaseMismatch
public const SchemaDiffKind ColumnNameCaseMismatch
value = SchemaDiffKind.ColumnNameCaseMismatch

A column exists under the expected name but in different letter case than the entity declares. Opt-in and informational only, like TableNameCaseMismatch.

CompressionMismatch
public const SchemaDiffKind CompressionMismatch
value = SchemaDiffKind.CompressionMismatch

The table is packed on disk differently from what the entity declares with [DataCompression]. Repacking loses nothing, but it rewrites every index of the table, so it is emitted as a statement to run rather than applied quietly.

ExtraColumn
public const SchemaDiffKind ExtraColumn
value = SchemaDiffKind.ExtraColumn

Column exists in database but not in entity.

ExtraForeignKey
public const SchemaDiffKind ExtraForeignKey
value = SchemaDiffKind.ExtraForeignKey

Database has a foreign-key constraint that no entity column declares. Informational only — never auto-dropped (mirrors ExtraColumn).

ExtraIndex
public const SchemaDiffKind ExtraIndex
value = SchemaDiffKind.ExtraIndex

Database has an index that no entity column declares. Informational only — never auto-dropped (mirrors ExtraColumn and ExtraForeignKey). Primary-key and unique-constraint backing indexes are filtered out before reaching this diff so they don't surface as false positives.

ExtraTable
public const SchemaDiffKind ExtraTable
value = SchemaDiffKind.ExtraTable

Table exists in the database but no entity maps to it. Surfaced only when the caller opts in (detectExtraTables on DbTableCompressionInfo})), because a partial entity set would otherwise flag every unrelated table. Never auto-dropped — emitted as a commented-out DROP TABLE (mirrors ExtraColumn).

ForeignKeyNameMismatch
public const SchemaDiffKind ForeignKeyNameMismatch
value = SchemaDiffKind.ForeignKeyNameMismatch

A foreign-key constraint in the database is not named per String). Opt-in and informational only, like PrimaryKeyNameMismatch.

IndexNameMismatch
public const SchemaDiffKind IndexNameMismatch
value = SchemaDiffKind.IndexNameMismatch

An index in the database is not named per Boolean). Indexes the model names explicitly (a composite Name) are exempt — the author chose that name deliberately. Opt-in and informational only, like PrimaryKeyNameMismatch.

MaxLengthMismatch
public const SchemaDiffKind MaxLengthMismatch
value = SchemaDiffKind.MaxLengthMismatch

Column max length differs between entity and database.

MissingColumn
public const SchemaDiffKind MissingColumn
value = SchemaDiffKind.MissingColumn

Column exists in entity but not in database.

MissingForeignKey
public const SchemaDiffKind MissingForeignKey
value = SchemaDiffKind.MissingForeignKey

Entity declares a [RelationSingle] column but the live database has no matching foreign-key constraint. Backfilled via ALTER TABLE … ADD CONSTRAINT.

MissingIndex
public const SchemaDiffKind MissingIndex
value = SchemaDiffKind.MissingIndex

Entity declares a [Index] (or [Unique]) column but the live database has no matching single-column index. Backfilled via CREATE INDEX by Schema}).

MissingTable
public const SchemaDiffKind MissingTable
value = SchemaDiffKind.MissingTable

Table exists in entity schema but not in database.

NullabilityMismatch
public const SchemaDiffKind NullabilityMismatch
value = SchemaDiffKind.NullabilityMismatch

Column nullability differs between entity and database.

PrecisionMismatch
public const SchemaDiffKind PrecisionMismatch
value = SchemaDiffKind.PrecisionMismatch

Column precision or scale differs between entity and database.

PrimaryKeyNameMismatch
public const SchemaDiffKind PrimaryKeyNameMismatch
value = SchemaDiffKind.PrimaryKeyNameMismatch

A primary-key constraint in the database is not named per String). Surfaced only when the caller opts in (checkNaming on DbTableCompressionInfo})). Informational only — renaming a constraint is a destructive operation, so it is never applied automatically (mirrors ExtraColumn).

TableNameCaseMismatch
public const SchemaDiffKind TableNameCaseMismatch
value = SchemaDiffKind.TableNameCaseMismatch

A table exists under the expected name but in different letter case than the entity declares. Tables are reconciled case-insensitively, so the drift is otherwise invisible — yet it breaks case-sensitive collations and quoted SQL. Opt-in and informational only, like PrimaryKeyNameMismatch.

TypeMismatch
public const SchemaDiffKind TypeMismatch
value = SchemaDiffKind.TypeMismatch

Column SQL type differs between entity and database.