Add option to migration operation classes for `if not exists`

Aperta
#2,406 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
mysql, postgresql, python, sqlite
Ambito
databases

Direzione di ricerca

Start by reading the migration operation classes and the SQL generation paths for add, alter, and drop operations; the issue does not name specific files or tests. Check how those operations target SQLite, PostgreSQL, and MySQL, then identify existing migration tests. Done means a boolean option produces the appropriate IF NOT EXISTS or IF EXISTS SQL for supported operations.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.
There are times during development when migrations diverge or a hotfix needs to happen now. It would be nice to be able to manually alter a migration file to make any operation succeed if the field or index already exists (or doesn't exists if its a removal).

Describe the solution you'd like
A simple boolean parameter added to the operation classes that triggers IF NOT EXISTS being added to the underlying SQL add/alter statement or IF EXISTS to the underlying SQL drop statment.

Lingua principale
Python
Stelle
5.6k
Fork
540
Merge medio
4g 4h
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tortoise/tortoise-orm

Tutte le issue di tortoise/tortoise-orm

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.