|
a/ForgeWiki/forgewiki/model/migrations.py |
|
b/ForgeWiki/forgewiki/model/migrations.py |
1 |
import cPickle as pickle
|
1 |
import cPickle as pickle
|
2 |
from itertools import chain
|
2 |
from itertools import chain
|
3 |
|
3 |
|
4 |
import pymongo
|
4 |
import bson
|
5 |
from ming.orm import state
|
5 |
from ming.orm import state
|
6 |
from pylons import c
|
6 |
from pylons import c
|
7 |
|
7 |
|
8 |
from flyway import Migration
|
8 |
from flyway import Migration
|
9 |
from allura.model import Thread, AppConfig, ArtifactReference
|
9 |
from allura.model import Thread, AppConfig, ArtifactReference
|
|
... |
|
... |
52 |
def _dump_ref(self, art):
|
52 |
def _dump_ref(self, art):
|
53 |
app_config = self.ormsession.get(AppConfig, art.app_config_id)
|
53 |
app_config = self.ormsession.get(AppConfig, art.app_config_id)
|
54 |
return ArtifactReference(dict(
|
54 |
return ArtifactReference(dict(
|
55 |
project_id=app_config.project_id,
|
55 |
project_id=app_config.project_id,
|
56 |
mount_point=app_config.options.mount_point,
|
56 |
mount_point=app_config.options.mount_point,
|
57 |
artifact_type=pymongo.bson.Binary(pickle.dumps(art.__class__)),
|
57 |
artifact_type=bson.Binary(pickle.dumps(art.__class__)),
|
58 |
artifact_id=art._id))
|
58 |
artifact_id=art._id))
|
59 |
|
59 |
|
60 |
|
60 |
|
61 |
class AddDeletedAttribute(WikiMigration):
|
61 |
class AddDeletedAttribute(WikiMigration):
|
62 |
version = 1
|
62 |
version = 1
|