@@ -302,95 +302,7 @@ def upgrade() -> None:
302302 ),
303303 )
304304
305- # 4. organization_invitations table
306- op .create_table (
307- "organization_invitations" ,
308- sa .Column (
309- "id" ,
310- sa .UUID (),
311- nullable = False ,
312- ),
313- sa .Column (
314- "organization_id" ,
315- sa .UUID (),
316- nullable = False ,
317- ),
318- sa .Column (
319- "email" ,
320- sa .String (),
321- nullable = False ,
322- ),
323- sa .Column (
324- "role" ,
325- sa .String (),
326- nullable = False ,
327- ),
328- sa .Column (
329- "token" ,
330- sa .String (),
331- nullable = False ,
332- ),
333- sa .Column (
334- "status" ,
335- sa .String (),
336- nullable = False ,
337- server_default = "pending" ,
338- ),
339- sa .Column (
340- "expires_at" ,
341- sa .TIMESTAMP (timezone = True ),
342- nullable = True ,
343- ),
344- sa .Column (
345- "created_at" ,
346- sa .TIMESTAMP (timezone = True ),
347- server_default = sa .text ("CURRENT_TIMESTAMP" ),
348- nullable = False ,
349- ),
350- sa .Column (
351- "updated_at" ,
352- sa .TIMESTAMP (timezone = True ),
353- nullable = True ,
354- ),
355- sa .Column (
356- "deleted_at" ,
357- sa .TIMESTAMP (timezone = True ),
358- nullable = True ,
359- ),
360- sa .Column (
361- "created_by_id" ,
362- sa .UUID (),
363- nullable = False ,
364- ),
365- sa .Column (
366- "updated_by_id" ,
367- sa .UUID (),
368- nullable = True ,
369- ),
370- sa .Column (
371- "deleted_by_id" ,
372- sa .UUID (),
373- nullable = True ,
374- ),
375- sa .PrimaryKeyConstraint ("id" ),
376- sa .ForeignKeyConstraint (
377- ["organization_id" ],
378- ["organizations.id" ],
379- ondelete = "CASCADE" ,
380- ),
381- sa .UniqueConstraint (
382- "token" ,
383- name = "uq_organization_invitations_token" ,
384- ),
385- sa .Index (
386- "ix_organization_invitations_org_email_status" ,
387- "organization_id" ,
388- "email" ,
389- "status" ,
390- ),
391- )
392-
393- # 5. Add is_active to users table
305+ # 4. Add is_active to users table
394306 op .add_column (
395307 "users" ,
396308 sa .Column (
@@ -406,12 +318,6 @@ def downgrade() -> None:
406318 # Drop in reverse order
407319 op .drop_column ("users" , "is_active" )
408320
409- op .drop_index (
410- "ix_organization_invitations_org_email_status" ,
411- table_name = "organization_invitations" ,
412- )
413- op .drop_table ("organization_invitations" )
414-
415321 op .drop_index (
416322 "ix_organization_providers_flags" ,
417323 table_name = "organization_providers" ,
0 commit comments