\r
def forwards(self, orm):\r
for n in orm.Node.objects.all():\r
- n.active_revision = n.revisions.order_by('-id')[0]\r
- n.save()\r
+ try:\r
+ n.active_revision = n.revisions.order_by('-id')[0]\r
+ n.save()\r
+ except:\r
+ r = orm.NodeRevision(author=n.author, body=n.body, title=n.title, revised_at=datetime.datetime.now(),\r
+ tagnames=n.tagnames, summary='Initial Revision', revision=1, node=n)\r
+ r.save()\r
+ n.active_revision = r\r
+ n.save()\r
\r
\r
def backwards(self, orm):\r