PyAr / pyarweb

El sitio web de Python Argentina
http://python.org.ar
Apache License 2.0
81 stars 99 forks source link

Error executing ./manage.py migrate #169

Closed gilgamezh closed 9 years ago

gilgamezh commented 9 years ago
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/management/__init__.py", line 385, in exec[200/585]
command_line
    utility.execute()
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/core/management/commands/migrate.py", line 160, in handl
e
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/migrations/executor.py", line 63, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/migrations/executor.py", line 97, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/migrations/migration.py", line 107, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/migrations/operations/fields.py", line 84, in databas
e_forwards
    schema_editor.remove_field(from_model, from_model._meta.get_field_by_name(self.name)[0])
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/backends/schema.py", line 439, in remove_field
    self.execute(sql)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/backends/schema.py", line 99, in execute
    cursor.execute(sql, params)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/utils/six.py", line 549, in reraise
    raise value.with_traceback(tb)
  File "/home/www-pyar/pyarweb_beta/pyarweb_venv/lib/python3.3/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: no existe la columna «zoom» en la relación «events_event»

I think is related to: git blame events/models.py

10e2ef6b (diegoduncan21 2014-03-02 22:10:11 -0300  1) from django.contrib.auth.models import User
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300  2) from django.db import models
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300  3) from django.utils.translation import ugettext_lazy as _
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300  4) 
10e2ef6b (diegoduncan21 2014-03-02 22:10:11 -0300  5) 
10e2ef6b (diegoduncan21 2014-03-02 22:10:11 -0300  6) class Event(models.Model):
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300  7)     """A PyAr events."""
10e2ef6b (diegoduncan21 2014-03-02 22:10:11 -0300  8) 
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300  9)     owner = models.ForeignKey(User)
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300 10)     name = models.CharField(max_length=100, verbose_name=_('Título'))
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300 11)     description = models.TextField(verbose_name=_('Descripcion'))
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300 12)     place = models.CharField(max_length=100, verbose_name=_('Lugar'))
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300 13)     lat = models.CharField(max_length=20)
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300 14)     lng = models.CharField(max_length=20)
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 15)     zoom = models.IntegerField(default=4)
9c4cca7d (Diego Duncan  2014-08-01 22:34:48 -0300 16)     address = models.CharField(max_length=100, verbose_name=_('Direccion'))
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 17)     url = models.URLField(blank=True, null=True)
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 18)     start_at = models.DateTimeField(verbose_name=_('Comienza a las'),
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 19)                                     blank=True, null=True)
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 20)     end_at = models.DateTimeField(verbose_name=_('Termina a las'),
7a4fb5e6 (Diego Duncan  2014-11-19 22:28:22 -0300 21)                                   blank=True, null=True)
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300 22)     created_at = models.DateTimeField(auto_now_add=True)
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300 23)     updated_at = models.DateTimeField(auto_now=True)
10e2ef6b (diegoduncan21 2014-03-02 22:10:11 -0300 24) 
34f6e608 (Diego         2014-04-17 05:12:53 -0300 25)     def __str__(self):
417be230 (diegoduncan21 2014-03-07 01:39:03 -0300 26)         return "%s by %s" % (self.name, self.owner)
mgaitan commented 9 years ago

relacionado a https://github.com/PyAr/pyarweb/issues/158

mgaitan commented 9 years ago

pudieron solucionar esto? a mi no me causa problemas.

gilgamezh commented 9 years ago

Solamente se podía reproducir con postgres. Con el push que hice se soluciona.

tzenderman commented 9 years ago

Desde que actualicé mi branch con los de PyAr-master, corro las migrations y tengo este traceback:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/commands/migrate.py", line 63, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/executor.py", line 17, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/loader.py", line 233, in build_graph
    self.graph.add_dependency(migration, key, parent)
  File "/usr/local/lib/python3.4/dist-packages/django/db/migrations/graph.py", line 42, in add_dependency
    raise KeyError("Migration %s dependencies reference nonexistent parent node %r" % (migration, parent))
KeyError: "Migration events.0004_auto_20141206_1111 dependencies reference nonexistent parent node ('events', '0003_auto_20141123_2045')"
edvm commented 9 years ago

Fixeado, el tema es que quedaron algunos migrations que no los sacamos con git rm, explicitamente: 0004_auto_20141206_1111.py 0005_auto_20141206_1301.py y 0004_auto_20141206_1111.py revienta porque hace referencia al 0003_auto_20141123_2045, banquenmen porque lo hice en el master del fork donde venia laburando y no se como pushear solamente este git rm xD

tzenderman commented 9 years ago

Closed with #189

diegoduncan21 commented 9 years ago

che que quilombo que arme con esto, mil disculpas. u.u

2014-12-08 12:57 GMT-03:00 Tim Zenderman notifications@github.com:

Closed #169 https://github.com/PyAr/pyarweb/issues/169.

— Reply to this email directly or view it on GitHub https://github.com/PyAr/pyarweb/issues/169#event-204264666.

Diego Puente