Files
authentik/lifecycle/system_migrations/version_history_create.py
dependabot[bot] a908efb792 core: bump black from 25.12.0 to 26.1.0 (#19567)
* core: bump black from 25.12.0 to 26.1.0

Bumps [black](https://github.com/psf/black) from 25.12.0 to 26.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/25.12.0...26.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-version: 26.1.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* lint

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-01-20 01:12:31 +01:00

23 lines
712 B
Python

# flake8: noqa
from lifecycle.migrate import BaseMigration
class Migration(BaseMigration):
def needs_migration(self) -> bool:
self.cur.execute(
"SELECT * FROM information_schema.tables WHERE table_name = 'authentik_version_history';"
)
return not bool(self.cur.rowcount)
def run(self):
self.cur.execute("""
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS authentik_version_history (
id BIGSERIAL PRIMARY KEY,
"timestamp" timestamp with time zone NOT NULL,
version text NOT NULL,
build text NOT NULL
);
COMMIT;
""")