Projet

Général

Profil

Bug #52915

jsonfield et confusion de type (colonnes encore en "text")

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
09 avril 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Analyse nécessaire.


Fichiers

Révisions associées

Révision 21976d8f (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

general: ensure jsonfields are using jsonb columns (#52915)

Révision b9ff8540 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

general: ensure jsonfields are using jsonb columns (fixup, #52915)

Révision 54950b51 (diff)
Ajouté par Frédéric Péters il y a environ 3 ans

general: ensure jsonfields are using jsonb columns (fixup2, #52915)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Tracker changé de Development à Bug
#2

Mis à jour par Frédéric Péters il y a environ 3 ans

import json
from combo.apps.wcs.models import *

for cell in WcsFormsOfCategoryCell.objects.all():
    if isinstance(cell.manual_order, str):
        print(cell, cell.page, cell.page.last_update_datetime)
        cell.manual_order = json.loads(json.loads(cell.manual_order))
        cell.save()

mais il y a d'autres cellules qui utilisent JSONField.

Mais il devrait y avoir alors davantage de sites qui plantent.

#3

Mis à jour par Frédéric Péters il y a environ 3 ans

En fait on a des colonnes qui sur certains tenants ne sont pas jsonb, a priori ceux qui ont été créés quand postgresql était encore en version 9.4; tous les soucis doivent venir de là.

#5

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Sujet changé de jsonfield et confusion et ça continue même en 1.11 et jsonfield 1.0 (les anciennes versions) à jsonfield et confusion de type (colonnes encore en "text")

On a géré cette situation dans Passerelle, il y a passerelle/base/migrations/0019_text_to_jsonb.py et passerelle/base/management/commands/ensure_jsonb.py, il faut intégrer la même chose.

#6

Mis à jour par Frédéric Péters il y a environ 3 ans

#7

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée
#8

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 21976d8f208f3cfe8a5368e9296fddf6d717d97a
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sun Apr 11 18:03:34 2021 +0200

    general: ensure jsonfields are using jsonb columns (#52915)
#9

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF