HUE-1306 [core] Introspect to skip previous alter field statements

Review Request #3106 — Created June 4, 2013 and updated

abec
old-hue-rw
HUE-1306
hue
enricoberti, romain
commit a4e4ba0bdec8ba7447c57954d4c0eb937297d296
Author: Abraham Elmahrek <abraham@elmahrek.com>
Date:   Tue Jun 4 14:15:18 2013 -0700

    HUE-1306 [core] Introspect to skip previous alter field statements

:100644 100644 675a6d3... ad9031a... M	apps/oozie/src/oozie/migrations/0020_chg_large_varchars_to_textfields.py
Tested against postgresql, mysql, and sqlite3
  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
romain
  1. 
      
  2. We probably just need to remove this as it always fails here for me:
    
     - Loading initial data for beeswax.
    No fixtures found.
    Running migrations for jobsub:
     - Migrating forwards to 0006_chg_varchars_to_textfields.
     > oozie:0001_initial
     > oozie:0002_auto__add_hive
     > oozie:0003_auto__add_sqoop
     > oozie:0004_auto__add_ssh
     > oozie:0005_auto__add_shell
     > oozie:0006_auto__chg_field_java_files__chg_field_java_archives__chg_field_sqoop_f
     > oozie:0007_auto__chg_field_sqoop_script_path
     > oozie:0008_auto__add_distcp
     > oozie:0009_auto__add_decision
     > oozie:0010_auto__add_fs
     > oozie:0011_auto__add_email
     > oozie:0012_auto__add_subworkflow__chg_field_email_subject__chg_field_email_body
     > oozie:0013_auto__add_generic
     > oozie:0014_auto__add_decisionend
     > oozie:0015_auto__add_field_dataset_advanced_start_instance__add_field_dataset_ins
     > oozie:0016_auto__add_field_coordinator_job_properties
     > oozie:0017_auto__add_bundledcoordinator__add_bundle
     > oozie:0018_auto__add_field_workflow_managed
     > oozie:0019_auto__add_field_java_capture_output
     > oozie:0020_chg_large_varchars_to_textfields
    Traceback (most recent call last):
      File "build/env/bin/hue", line 8, in <module>
        load_entry_point('desktop==2.3.0', 'console_scripts', 'hue')()
      File "/home/romain/projects/hue/desktop/core/src/desktop/manage_entry.py", line 60, in entry
        execute_manager(settings)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/__init__.py", line 438, in execute_manager
        utility.execute()
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/__init__.py", line 379, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/romain/projects/hue/desktop/core/src/desktop/management/commands/test.py", line 96, in run_from_argv
        ret = nose_runner.run_tests_explicit(nose_args, interactive=True, verbosity=1)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/django_nose-0.5-py2.7.egg/django_nose/nose_runner.py", line 63, in run_tests_explicit
        connection.creation.create_test_db(verbosity, autoclobber=not interactive)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/db/backends/creation.py", line 353, in create_test_db
        call_command('syncdb', verbosity=verbosity, interactive=False, database=self.connection.alias)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/__init__.py", line 166, in call_command
        return klass.execute(*args, **defaults)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/base.py", line 220, in execute
        output = self.handle(*args, **options)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/base.py", line 351, in handle
        return self.handle_noargs(**options)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/management/commands/syncdb.py", line 82, in handle_noargs
        management.call_command('migrate', **options)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/__init__.py", line 166, in call_command
        return klass.execute(*args, **defaults)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/management/base.py", line 220, in execute
        output = self.handle(*args, **options)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/management/commands/migrate.py", line 102, in handle
        delete_ghosts = delete_ghosts,
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/__init__.py", line 202, in migrate_app
        success = migrator.migrate_many(target, workplan, database)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 215, in migrate_many
        result = migrator.__class__.migrate_many(migrator, target, migrations, database)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 284, in migrate_many
        result = self.migrate(migration, database)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 121, in migrate
        result = self.run(migration)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 95, in run
        return self.run_migration(migration)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 77, in run_migration
        migration_function()
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/migration/migrators.py", line 56, in <lambda>
        return (lambda: direction(orm))
      File "/home/romain/projects/hue/apps/oozie/src/oozie/migrations/0020_chg_large_varchars_to_textfields.py", line 13, in forwards
        db.alter_column('jobsub_ooziejavaaction', 'args', self.gf('django.db.models.fields.TextField')(blank=True))
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/db/sqlite3.py", line 116, in alter_column
        self._remake_table(table_name, altered={name: sql})
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/db/sqlite3.py", line 73, in _remake_table
        ", ".join(["%s %s" % (self.quote_name(cname), ctype) for cname, ctype in definitions.items()]),
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/South-0.7-py2.7.egg/south/db/generic.py", line 134, in execute
        cursor.execute(sql, params)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/db/backends/util.py", line 15, in execute
        return self.cursor.execute(sql, params)
      File "/home/romain/projects/hue/build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/db/backends/sqlite3/base.py", line 200, in execute
        return Database.Cursor.execute(self, query, params)
    django.db.utils.DatabaseError: near ")": syntax error
    
    
    I am testing it or did you find a way to reproduce it easily?
  3. 
      
Loading...