Allow force running of --once if current.sql has not changed

Abierto
#210 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Empieza siguiendo el tratamiento de --once y la lógica que detecta si current.sql ha cambiado. Determina cómo debería interactuar una opción force con esa comprobación y, después, verifica el comportamiento con las pruebas de migración existentes o con los puntos de entrada de pruebas que encuentres; se considera terminado cuando un current.sql sin cambios puede ejecutarse repetidamente al forzarlo explícitamente.

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

Descripción

Feature description

Often we use tricks like select n and increment the number or change current.sql in another way to get it to run.

It would be handy to have a flag to force run --once if the file hasn't changed.

Motivating example

When testing a data migration, it is often very handy to have an idempotent migration that can get run multiple times as you add/change data in your application.

Typical workflow for me in a data migration involves

  • Keep the original data I am moving in place (if possible)
  • Run the migration, check for base functionality, compare against existing
  • Add more data to test the migration and run it again (rinse and repeat as needed)
  • Once tested, add code to cleanup the original data, test again, and ship

Though workarounds are simple as described in the feature description, I think it would be a nice add.

Breaking changes

n/a

Supporting development

I [tick all that apply]:

  • am interested in building this feature myself
  • am interested in collaborating on building this feature
  • [ x ] am willing to help testing this feature before it's released
  • am willing to write a test-driven test suite for this feature (before it exists)
  • [ x ] am a Graphile sponsor ❤️
  • [ x ] have an active support or consultancy contract with Graphile
Lenguaje dominante
TypeScript
Estrellas
836
Forks
71
Métricas de merge de PR
Sin PR fusionados en 30 d

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 graphile/migrate

Todos los issues de graphile/migrate

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.