# fix\(server\): migrate-dev-db refuses V2 sources with unimported legacy threads · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/4324451c0aa64be89316fa6c48312bf9174bc093)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 4324451c0aa64be89316fa6c48312bf9174bc093

Requested commit: 4324451c0aa64be89316fa6c48312bf9174bc093

Commit: 4324451c0aa64be89316fa6c48312bf9174bc093

Tree: 5256b9a416a9502019792b3a8cd2f9678a646630

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): migrate-dev-db refuses V2 sources with unimported legacy threads

The legacy guard returned early once the V2 tables existed, but the server
imports V1 threads at boot rather than in a migration. A source migrated to
V2 without ever booting kept its legacy threads only in projection_threads,
so the copy succeeded with zero threads. Count V1 threads without a V2
thread.created event, as LegacyV1ThreadImporter.pendingThreadCount does,
regardless of schema version. The error now points at the statev2.sqlite a
server leaves behind after importing a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [985785676269f59c7f5acb882e723dcdf8c34e71](https://git.cafe/pingdotgg/t3code/commit/985785676269f59c7f5acb882e723dcdf8c34e71?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/4324451c0aa64be89316fa6c48312bf9174bc093?format=markdown)
