Просмотр исходного кода

Drops 'files in database' feature remaining pieces

Adrien Panay 7 лет назад
Родитель
Сommit
c8eeec4ece

+ 26 - 0
tracim/migration/versions/f3852e1349c4_all_files_only_on_disk.py Просмотреть файл

@@ -0,0 +1,26 @@
1
+"""all files only on disk
2
+
3
+Revision ID: f3852e1349c4
4
+Revises: 913efdf409e5
5
+Create Date: 2017-07-24 17:15:54.278141
6
+
7
+"""
8
+
9
+from alembic import op
10
+import sqlalchemy as sa
11
+
12
+# revision identifiers, used by Alembic.
13
+revision = 'f3852e1349c4'
14
+down_revision = '913efdf409e5'
15
+
16
+
17
+def upgrade():
18
+    """Drops the file content from revision."""
19
+    with op.batch_alter_table('content_revisions') as batch_op:
20
+        batch_op.drop_column('file_content')
21
+
22
+
23
+def downgrade():
24
+    """Adds the file content in revision."""
25
+    with op.batch_alter_table('content_revisions') as batch_op:
26
+        batch_op.add_column(sa.Column('file_content', sa.LargeBinary))

+ 0 - 1
tracim/tracim/model/data.py Просмотреть файл

@@ -546,7 +546,6 @@ class ContentRevisionRO(DeclarativeBase):
546 546
         server_default='',
547 547
     )
548 548
     file_mimetype = Column(Unicode(255),  unique=False, nullable=False, default='')
549
-    file_content = deferred(Column(LargeBinary(), unique=False, nullable=True))
550 549
     # INFO - A.P - 2017-07-03 - Depot Doc
551 550
     # http://depot.readthedocs.io/en/latest/#attaching-files-to-models
552 551
     # http://depot.readthedocs.io/en/latest/api.html#module-depot.fields