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 channel_integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
which provides an API that can be used to transmit EdX data to the third-party system.
"""

__version__ = '0.1.20'
__version__ = '0.1.21'
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE blackboard_channel_blackboardenterprisecustomerconfiguration MODIFY uuid uuid NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE blackboard_channel_blackboardenterprisecustomerconfiguration MODIFY uuid char(32) NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


class Migration(migrations.Migration):
dependencies = [
('blackboard_channel', '0003_alter_blackboardenterprisecustomerconfiguration_id_and_more'),
]
operations = [
migrations.RunPython(
code=apply_mariadb_migration,
reverse_code=reverse_mariadb_migration,
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE canvas_channel_canvasenterprisecustomerconfiguration MODIFY uuid uuid NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE canvas_channel_canvasenterprisecustomerconfiguration MODIFY uuid char(32) NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


class Migration(migrations.Migration):
dependencies = [
('canvas_channel', '0003_alter_canvasenterprisecustomerconfiguration_id_and_more'),
]
operations = [
migrations.RunPython(
code=apply_mariadb_migration,
reverse_code=reverse_mariadb_migration,
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE channel_integration_genericlearnerdatatransmissionaudit MODIFY enterprise_customer_uuid uuid NULL")
cursor.execute("ALTER TABLE channel_integration_contentmetadataitemtransmission MODIFY enterprise_customer_catalog_uuid uuid NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


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("SET FOREIGN_KEY_CHECKS=0")
cursor.execute("ALTER TABLE channel_integration_genericlearnerdatatransmissionaudit MODIFY enterprise_customer_uuid char(32) NULL")
cursor.execute("ALTER TABLE channel_integration_contentmetadataitemtransmission MODIFY enterprise_customer_catalog_uuid char(32) NOT NULL")
cursor.execute("SET FOREIGN_KEY_CHECKS=1")


class Migration(migrations.Migration):
dependencies = [
('channel_integration', '0004_alter_apiresponserecord_id_and_more'),
]
operations = [
migrations.RunPython(
code=apply_mariadb_migration,
reverse_code=reverse_mariadb_migration,
),
]