@@ -35,6 +35,7 @@ def _get_inspector() -> sa.engine.reflection.Inspector:
3535def _add_column (
3636 table : str ,
3737 column_name : str ,
38+ nullable : bool ,
3839 type_ : sa .types .TypeEngine ,
3940 value : str | None = None ,
4041) -> None :
@@ -44,7 +45,7 @@ def _add_column(
4445 sa .Column (
4546 column_name ,
4647 type_ ,
47- nullable = False ,
48+ nullable = nullable ,
4849 server_default = value ,
4950 ),
5051 )
@@ -112,8 +113,8 @@ def upgrade() -> None:
112113 )
113114
114115 if _table_exists (tasks_table ):
115- _add_column (tasks_table , 'owner' , sa .String (128 ), owner )
116- _add_column (tasks_table , 'last_updated' , sa .DateTime (timezone = True ))
116+ _add_column (tasks_table , 'owner' , False , sa .String (128 ), owner )
117+ _add_column (tasks_table , 'last_updated' , True , sa .DateTime ())
117118 _add_index (
118119 tasks_table ,
119120 f'idx_{ tasks_table } _owner_last_updated' ,
@@ -126,7 +127,11 @@ def upgrade() -> None:
126127
127128 if _table_exists (push_notification_configs_table ):
128129 _add_column (
129- push_notification_configs_table , 'owner' , sa .String (128 ), owner
130+ push_notification_configs_table ,
131+ 'owner' ,
132+ False ,
133+ sa .String (128 ),
134+ owner ,
130135 )
131136 else :
132137 logging .warning (
0 commit comments