Kaynağa Gözat

Drops depot global declaration in last migration

Adrien Panay 7 yıl önce
ebeveyn
işleme
089bd059f5

+ 7 - 7
tracim/migration/versions/913efdf409e5_all_files_also_on_disk.py Dosyayı Görüntüle

@@ -25,12 +25,6 @@ down_revision = '69fb10c3d6f0'
25 25
 # Session = sessionmaker()
26 26
 # DeclarativeBase = declarative_base()
27 27
 
28
-DepotManager.configure(
29
-    'default', {
30
-    'depot.storage_path': 'depot/',
31
-})
32
-# DepotManager.set_default('default')
33
-
34 28
 revision_helper = sa.Table(
35 29
     'content_revisions',
36 30
     sa.MetaData(),
@@ -105,8 +99,14 @@ def upgrade():
105 99
 
106 100
     # fill_depot_file_fields()
107 101
 
102
+    # Creates files depot used in this migration:
103
+    # - 'default': depot used until now,
104
+    DepotManager.configure(
105
+        'default', {'depot.storage_path': 'depot/'},
106
+    )
107
+    depot = DepotManager.get('default')
108
+
108 109
     connection = op.get_bind()
109
-    depot = DepotManager.get()
110 110
 
111 111
     file_revision_query = revision_helper.select() \
112 112
         .where(revision_helper.c.type == 'file')