# Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite错误1：'没有这样的列：x'

- **ID:** `dotnet/ef-core-sqlite-no-net-changes`
- **领域:** dotnet
- **类别:** data_error
- **错误码:** `0x80004005`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

Entity Framework Core迁移未应用到SQLite数据库，实际架构与模型预期不匹配，导致查询引用了不存在的列。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| EF Core 6.0 | active | — | — |
| EF Core 7.0 | active | — | — |
| EF Core 8.0 | active | — | — |
| SQLite 3.x | active | — | — |

## 解决方案

1. ```
   Run 'dotnet ef database update' from the project directory to apply all pending migrations to the SQLite database.
   ```
2. ```
   If migrations are missing, create an initial migration: 'dotnet ef migrations add InitialCreate' then run update.
   ```

## 无效尝试

- **Adding a new migration and updating the database without reconciling the migration history** — The migration history table in SQLite may be out of sync, causing EF to skip pending migrations. (30% 失败率)
- **Deleting the database file and recreating it manually** — This loses all data and the migration history, but the error persists if the schema is not recreated via migrations. (50% 失败率)
