On Tuesday 12 May 2009 04:41:06 Christian Hammond wrote:

> As for the DB change, we have a nice database migration system in place.
> You pretty much need to just make the change to the appropriate Model
> class(es) and then add an Evolution definition (see reviews/evolutions/*.py
> for example).

Is it possible to express schema evolution in terms of django_evolution calls, 
not raw SQLs?

As for model change, I think it would be smth like this:

diff --git a/reviews/models.py b/reviews/models.py
index 570551c..38e112b 100644
--- a/reviews/models.py
+++ b/reviews/models.py
@@ -180,7 +180,7 @@ class ReviewRequest(models.Model):
     status = models.CharField(_("status"), max_length=1, choices=STATUSES,
     public = models.BooleanField(_("public"), default=False)
-    changenum = models.PositiveIntegerField(_("change number"), blank=True,
+    change_id = models.CharField(_("change ID"), max_length=255,  blank=True,
                                             null=True, db_index=True)
     repository = models.ForeignKey(Repository,

but I'm not sure how existing RB DBs should be evolved. Seems that neither 
djblets' FakeChangeFieldType nor django_evolution's ChangeField isn't 
suitable for the task. Simply add a field and then write a raw SQL to copy 
data? Would it be portable enough?  Any comments?

Alexey Morozov

You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to