#1868 frontend: fix alembic migration
Merged 2 years ago by praiskup. Opened 2 years ago by schlupov.
copr/ schlupov/copr fix_user_proxy_migration  into  main

frontend: fix alembic migration
Silvie Chlupova • 2 years ago  
@@ -15,7 +15,8 @@ 

  

  

  def upgrade():

-     op.execute("""delete from "user" where proxy = true""")

+     op.execute("""delete from user_private  where user_id=(select id from "user" WHERE proxy = true);""")

+     op.execute("""delete from "user" where proxy = true;""")

      op.drop_column('user', 'proxy')

  

  

The user also has to be deleted from the user_private
table.
At the time I created the migration, I didn't have the last database dump with me, so I only discovered this issue today.

Relates: #1859

Build succeeded.

It's surprising to me that it wasn't deleted via cascade ...
Do we want to setup it?

In some future PR, maybe. Now I would like to have this PR merged so that migrations work again.

Sure, I have no problem with that :-)

rebased onto 7f89ec8

2 years ago

Build succeeded.

Pull-Request has been merged by praiskup

2 years ago