-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(1.7): update pg_stat_extension if it is not of the correct version
- Loading branch information
1 parent
baf0a60
commit c232faa
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.2.9 on 2024-01-17 03:19 | ||
import logging | ||
|
||
from django.db import OperationalError, connection, migrations | ||
|
||
|
||
def create_extension(apps, schema_editor): | ||
try: | ||
with connection.cursor() as cursor: | ||
cursor.execute("select extversion from pg_extension where extname = 'pg_stat_statements'") | ||
version = float(cursor.fetchone()[0]) | ||
if version < 1.9: | ||
cursor.execute("alter extension pg_stat_statements update to '1.9'") | ||
cursor.execute("alter extension pg_stat_statements update to '1.10'") | ||
except OperationalError: | ||
logging.error("Could not update extension `pg_stat_statements`.") | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("django_pev", "0001_enable_extensions"), | ||
] | ||
|
||
operations = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "django-pev" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
description = "Context manager to upload explain plans to https://explain.dalibo.com/" | ||
authors = ["william chu <[email protected]>"] | ||
readme = "README.md" | ||
|