18cfe67719
* core: bump black from 22.12.0 to 23.1.0 Bumps [black](https://github.com/psf/black) from 22.12.0 to 23.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.12.0...23.1.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * re-format Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
21 lines
616 B
Python
21 lines
616 B
Python
# 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()
|