@@ -109,9 +109,7 @@ def upgrade() -> None:
109109
110110 op .add_column ("tools" , sa .Column ("id_new" , sa .String (36 ), nullable = True ))
111111 op .add_column ("tools" , sa .Column ("original_name" , sa .String (), nullable = True ))
112- # op.add_column("tools", sa.Column("original_name_slug", sa.String(), nullable=True))
113- op .add_column ("tools" , sa .Column ("custom_name" , sa .String (), nullable = True ))
114- op .add_column ("tools" , sa .Column ("custom_name_slug" , sa .String (), nullable = True ))
112+ op .add_column ("tools" , sa .Column ("original_name_slug" , sa .String (), nullable = True ))
115113 op .add_column ("tools" , sa .Column ("name_new" , sa .String (), nullable = True ))
116114 op .add_column ("tools" , sa .Column ("gateway_id_new" , sa .String (36 ), nullable = True ))
117115
@@ -147,7 +145,7 @@ def upgrade() -> None:
147145 UPDATE tools
148146 SET id_new=:u,
149147 original_name=:on,
150- custom_name_slug =:ons,
148+ original_name_slug =:ons,
151149 name_new = CASE
152150 WHEN :g IS NOT NULL THEN (SELECT slug FROM gateways WHERE id = :g) || :sep || :ons
153151 ELSE :ons
@@ -236,9 +234,7 @@ def upgrade() -> None:
236234 batch_op .drop_column ("name" )
237235 batch_op .alter_column ("name_new" , new_column_name = "name" , nullable = True )
238236 batch_op .alter_column ("original_name" , nullable = False )
239- # batch_op.alter_column("original_name_slug", nullable=False)
240- batch_op .alter_column ("custom_name" , nullable = False )
241- batch_op .alter_column ("custom_name_slug" , nullable = False )
237+ batch_op .alter_column ("original_name_slug" , nullable = False )
242238 batch_op .create_unique_constraint ("uq_tools_name" , ["name" ])
243239 batch_op .create_unique_constraint ("uq_gateway_id__original_name" , ["gateway_id" , "original_name" ])
244240
@@ -549,10 +545,8 @@ def downgrade() -> None:
549545 op .drop_column ("servers" , "id_new" )
550546 op .drop_column ("tools" , "gateway_id_new" )
551547 op .drop_column ("tools" , "name_new" )
552- # op.drop_column("tools", "original_name_slug")
548+ op .drop_column ("tools" , "original_name_slug" )
553549 op .drop_column ("tools" , "original_name" )
554550 op .drop_column ("tools" , "id_new" )
555551 op .drop_column ("gateways" , "id_new" )
556- op .drop_column ("gateways" , "slug" )
557- op .drop_column ("tools" , "custom_name_slug" )
558- op .drop_column ("tools" , "custom_name" )
552+ op .drop_column ("gateways" , "slug" )
0 commit comments