Hi All,

I'm working on an API-server project that uses dynamically generated Django 
models, so it can service many user-provided datasets. To ease maintenance 
work, we'd like to generate the SQL statements to migrate database tables 
to a newer version of the schema. I've managed to use the internal Django 
migration API's for this.

Unfortunately, the call to migration.apply(old_state, schema_editor, 
collect_sql=True) breaks when there is more then one operation in the 
migration object. The ProjectState model fields get bound to a model, and 
therefore the next operation won't run.

Is there anything we're doing wrong? Or maybe we're using this migration 
API in ways that aren't foreseen in its design, but can be worked around?

(code is here in a branch: 
https://github.com/Amsterdam/schema-tools/blob/diederik/sqlmigrate-schema/src/schematools/contrib/django/management/commands/sqlmigrate_schema.py)

Best,
Diederik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c54b72b-7c3b-4f93-b9db-e77e77b5925dn%40googlegroups.com.

Reply via email to