File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ """drops required constraint of prefix
2
+
3
+ Revision ID: 6b3a877ee8e4
4
+ Revises: d8fb062b42d6
5
+ Create Date: 2023-04-18 01:24:48.681012
6
+
7
+ """
8
+ from alembic import op
9
+ import sqlalchemy as sa
10
+
11
+
12
+ # revision identifiers, used by Alembic.
13
+ revision = '6b3a877ee8e4'
14
+ down_revision = 'd8fb062b42d6'
15
+ branch_labels = None
16
+ depends_on = None
17
+
18
+
19
+ def upgrade ():
20
+ # ### commands auto generated by Alembic - please adjust! ###
21
+ op .alter_column ('s3_file_metadata' , 'prefix' ,
22
+ existing_type = sa .VARCHAR (),
23
+ nullable = True )
24
+ # ### end Alembic commands ###
25
+
26
+
27
+ def downgrade ():
28
+ # ### commands auto generated by Alembic - please adjust! ###
29
+ op .alter_column ('s3_file_metadata' , 'prefix' ,
30
+ existing_type = sa .VARCHAR (),
31
+ nullable = False )
32
+ # ### end Alembic commands ###
Original file line number Diff line number Diff line change 2
2
3
3
4
4
"""
5
+ from typing import Optional
5
6
from uuid import uuid4
6
7
from datetime import timedelta
7
8
from typing import Union
@@ -54,8 +55,12 @@ class S3FileMetadata(
54
55
55
56
__tablename__ = "s3_file_metadata"
56
57
58
+ # This is the unique key for this object store in the associated bucket
59
+ # which is automatically assigned to the metadata, you do not have to
60
+ # worry about it simply deal with the wrapped methods provided by this class
57
61
s3_key : Mapped [str ]
58
- prefix : Mapped [str ]
62
+ # Prefix where you want the object to be stored e.g images, files
63
+ prefix : Mapped [Optional [str ]]
59
64
60
65
file_name : Mapped [str ]
61
66
file_size : Mapped [int ]
You can’t perform that action at this time.
0 commit comments