Add mix task to undo latest codegen/delete latest migration

Abierto
#490 16 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
elixir, postgresql
Área
cli, databases

Línea de trabajo

Comienza localizando la mix task que genera migraciones y el código responsable de los archivos de migración y de snapshots de tablas. Traza cómo se identifican la migración más reciente y sus snapshots asociados, y luego revisa las pruebas existentes de la task o las pruebas de generación de migraciones. La tarea estará terminada cuando una task llamada ash_postgres.delete_latest_migration elimine únicamente la migración más reciente y sus snapshots después de confirmar el nombre de la migración.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement needs review

Is your feature request related to a problem? Please describe.

Codegen to generate a migration is really awesome, but sometimes you generate a migration and then you realize you missed something, so you want to delete that migration, make the change, and then generate it again. Currently that's a manual process - go find the migration, find the snapshots for all the relevant tables, delete them all, and do it again. It's pretty annoying!

Describe the solution you'd like

A task like ash_postgres.delete_latest_migration that will delete the last migration, and any snapshots that were created at the same time. No option to delete other migrations or anything like that - only the last one.

And it should probably confirm the name of the migration just to make sure!

Describe alternatives you've considered

You could just generate another migration with the added changes, but snapshot files are big and ugly and if you haven't even run the first migration, being able to undo/regenerate it seems like the smarter approach.

Lenguaje dominante
Elixir
Estrellas
191
Forks
186
Merge medio
16 h 4 min
PR fusionados (30 d)
17

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ash-project/ash_postgres

Todos los issues de ash-project/ash_postgres

Issues similares

Más issues de Elixir

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.