Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openedx_ledger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
A library that records transactions against a ledger, denominated in units of value.
"""
__version__ = "1.6.12"
__version__ = "1.6.13"
44 changes: 44 additions & 0 deletions openedx_ledger/migrations/0016_mariadb_uuid_conversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated migration for MariaDB UUID field conversion (Django 5.2)
"""
Migration to convert UUIDField from char(32) to uuid type for MariaDB compatibility.
"""

from django.db import migrations


def apply_mariadb_migration(apps, schema_editor):
connection = schema_editor.connection
if connection.vendor != 'mysql':
return
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
if 'mariadb' not in version.lower():
return
with connection.cursor() as cursor:
cursor.execute("ALTER TABLE openedx_ledger_transaction MODIFY idempotency_key uuid NULL")


def reverse_mariadb_migration(apps, schema_editor):
connection = schema_editor.connection
if connection.vendor != 'mysql':
return
with connection.cursor() as cursor:
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()[0]
if 'mariadb' not in version.lower():
return
with connection.cursor() as cursor:
cursor.execute("ALTER TABLE openedx_ledger_transaction MODIFY idempotency_key char(32) NULL")


class Migration(migrations.Migration):
dependencies = [
('openedx_ledger', '0015_add_course_run_start_date_to_transaction'),
]
operations = [
migrations.RunPython(
code=apply_mariadb_migration,
reverse_code=reverse_mariadb_migration,
),
]