Project

General

Profile

Bug #22782

Échec de migration oauth2.0003_auto_20180322_1016

Added by Frédéric Péters over 1 year ago. Updated over 1 year ago.

Status:
Fermé
Priority:
Normal
Assignee:
-
Target version:
Start date:
24 Mar 2018
Due date:
% Done:

0%

Patch proposed:
Yes
Planning:
No

Description

Sur fargo.dev et alfortville.dev, lors des mises à jour automatique,

  Rendering model states... DONE (0.112s)
  Applying oauth2.0003_auto_20180322_1016...Traceback (most recent call last):
  File "/usr/lib/fargo/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/hobo/multitenant/management/commands/migrate_schemas.py", line 53, in handle
    self.run_migrations(tenant.schema_name, settings.TENANT_APPS)
  File "/usr/lib/python2.7/dist-packages/hobo/multitenant/management/commands/migrate_schemas.py", line 60, in run_migrations
    command.execute(*self.args, **self.options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 222, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 110, in migrate
    self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 148, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/migration.py", line 115, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/operations/fields.py", line 62, in database_forwards
    field,
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/schema.py", line 18, in add_field
    super(DatabaseSchemaEditor, self).add_field(model, field)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 398, in add_field
    self.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 100, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.DataError: ERREUR:  valeur trop longue pour le type character varying(16)

0001-oauth2-extend-oauth2tempfile-uuid-to-32-characters-2.patch View (1.66 KB) Frédéric Péters, 24 Mar 2018 08:31 AM

Associated revisions

Revision a0a4c796 (diff)
Added by Frédéric Péters over 1 year ago

oauth2: extend oauth2tempfile uuid to 32 characters (#22782)

History

#1 Updated by Frédéric Péters over 1 year ago

             field=models.CharField(default=fargo.oauth2.models.generate_uuid, max_length=16, primary_key=True, serialize=False),

mais

def generate_uuid():
    return uuid.uuid4().hex

Patch pas testé au-delà de l'exécution de la migration dans mon environnement publik avec postgresql; mais la seule utilisation que je vois de l'uuid c'est dans l'URL oauth2-put-document-authorize et elle accepte 32 caractères sans soucis.

#2 Updated by Benjamin Dauvergne over 1 year ago

Pas vu parce que les tests tournent en sqlite et sqlite ne respecte pas les contraintes de longueur sur les varchar, tout est text en fait.

Ack.

#3 Updated by Frédéric Péters over 1 year ago

  • Status changed from En cours to Résolu (à déployer)
commit a0a4c7962f49db6060f73a33f243d9aaebd3e272
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Sat Mar 24 08:30:33 2018 +0100

    oauth2: extend oauth2tempfile uuid to 32 characters (#22782)

#4 Updated by Benjamin Dauvergne over 1 year ago

  • Target version set to 0.25

#5 Updated by Frédéric Péters over 1 year ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF