`bos db repair --mode history-reset` drops the shared journal for every workspace and re-applies migrations into `public`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- postgresql, typescript
Línea de trabajo
Start with services/db/repair.ts, then read db/core.ts and the workspace drizzle.config.ts files to confirm how the shared journal and schema are selected. Compare the repair path with runMigrations and its search path handling. Done means repair preserves other workspaces' migration history and applies or safely refuses migrations for the target workspace schema.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
everything-dev 2.0.0-rc.27
Where
services/db/repair.ts:
-
Journal reset is not slug-scoped — `dist/services/db/repair.mjs:60`:
```ts
await pool.query(`DROP TABLE IF EXISTS ${journalRef}`);
```
The journal table is shared by all workspaces on one database (`getMigrationStorage` default; `PER_PLUGIN_ISOLATION = false` in `db/core.ts`), so "reset the migration history" for plugin A silently wipes the recorded history of every other plugin and the api workspace on that database. -
Reapply targets the wrong schema — the fix path re-runs drizzle-kit migrate via each workspace's `drizzle.config.ts`. That config maps the journal schema/table but has no notion of the v2 data schema, so drizzle-kit creates/validates tables in the session `search_path` (`public`). The v2 runtime (`runMigrations`) scopes plugin tables into `plugin_` (it even strips `"public".` prefixes from migration SQL and runs under `search_path="plugin_,public"`).
Consequences (observed on nearbuilders.org during a v1→v2 consolidation)
- On a v1 per-plugin DB that boots with `drift-safe-repair` (runtime checks `plugin_`, finds journal hashes + tables in `public` only): repair cannot fix the boot — the runtime error persists, and repair may instead recreate tables in `public`.
- On a healthy consolidated database: repair destroys every workspace's journal and can spray `public`-schema copies of plugin tables.
Suggested fix
- Make the journal operation slug-scoped under the shared-journal topology: delete only the target workspace's migration hashes (the history rows whose hashes the workspace's local migrations reference).
- Re-apply migrations under the workspace's data schema (`search_path = plugin_,public`), matching what the runtime runner does — or reuse `runMigrations` directly.
- Alternatively: refuse to run against the shared-journal topology and point users at re-baseline/consolidation tooling.
Note: because the runtime runner is drift-tolerant (the tables-present preflight records migration hashes as applied without replaying DDL), an actual journal-only reset usually self-heals on next boot when tables exist in the right schema — a `public`-targeted drizzle-kit pass adds risk without fixing anything.
- Lenguaje dominante
- TypeScript
- Estrellas
- 5
- Forks
- 3
- Merge medio
- 9 h 16 min
- PR fusionados (30 d)
- 160
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NEARBuilders/everything-dev
-
NEAR Builders project-creation prompt: agent should return the project URL, not just the slugAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
NEARBuilders/everything-dev#686 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NEARBuilders/everything-dev#678 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
NEARBuilders/everything-dev#628 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NEARBuilders/everything-dev#400 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
NEARBuilders/everything-dev#685 ·
Los mantenedores suelen responder en 1 día
Todos los issues de NEARBuilders/everything-dev
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ehmpathy/rhachet-roles-ehmpathy#1231 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Equal-Vote/bettervoting#1754 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Doist/todoist-sdk-typescript#740 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
privatenumber/cleye#47 ·
-
spec-feedback
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100