polices/hibp: remove deprecated (#4363)
* remove hibp Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * don't save event matcher apps in migrations Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * cleanup migrations Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> * update docs, update some phrasing Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
19
lifecycle/system_migrations/to_2023_1_hibp_remove.py
Normal file
19
lifecycle/system_migrations/to_2023_1_hibp_remove.py
Normal file
@ -0,0 +1,19 @@
|
||||
# flake8: noqa
|
||||
from lifecycle.migrate import BaseMigration
|
||||
|
||||
SQL_STATEMENT = """BEGIN TRANSACTION;
|
||||
DROP TABLE "authentik_policies_hibp_haveibeenpwendpolicy";
|
||||
DELETE FROM django_migrations WHERE app = 'authentik_policies_hibp';
|
||||
END TRANSACTION;"""
|
||||
|
||||
|
||||
class Migration(BaseMigration):
|
||||
def needs_migration(self) -> bool:
|
||||
self.cur.execute(
|
||||
"SELECT * FROM information_schema.tables WHERE table_name = 'authentik_policies_hibp_haveibeenpwendpolicy';"
|
||||
)
|
||||
return bool(self.cur.rowcount)
|
||||
|
||||
def run(self):
|
||||
self.cur.execute(SQL_STATEMENT)
|
||||
self.con.commit()
|
Reference in New Issue
Block a user