agendas: fix migration (#54969)
This commit is contained in:
parent
f9b5089f06
commit
577a492cd2
|
@ -1,5 +1,5 @@
|
|||
from dateutil.rrule import DAILY, WEEKLY
|
||||
from django.db import migrations
|
||||
from django.db import migrations, transaction
|
||||
from django.db.utils import ProgrammingError
|
||||
|
||||
|
||||
|
@ -49,8 +49,9 @@ class Migration(migrations.Migration):
|
|||
|
||||
def _check_db(self, project_state, schema_editor):
|
||||
try:
|
||||
# check if the column exists
|
||||
schema_editor.execute('SELECT recurrence_rule FROM agendas_event')
|
||||
with transaction.atomic():
|
||||
# check if the column exists
|
||||
schema_editor.execute('SELECT recurrence_rule FROM agendas_event')
|
||||
except ProgrammingError:
|
||||
# if not exists, ignore the migration
|
||||
return project_state
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import migrations
|
||||
from django.db import migrations, transaction
|
||||
from django.db.utils import ProgrammingError
|
||||
|
||||
|
||||
|
@ -21,8 +21,9 @@ class Migration(migrations.Migration):
|
|||
|
||||
def _check_db(self, project_state, schema_editor):
|
||||
try:
|
||||
# check if the column exists
|
||||
schema_editor.execute('SELECT recurrence_rule FROM agendas_event')
|
||||
with transaction.atomic():
|
||||
# check if the column exists
|
||||
schema_editor.execute('SELECT recurrence_rule FROM agendas_event')
|
||||
except ProgrammingError:
|
||||
# if not exists, ignore the migration
|
||||
return project_state
|
||||
|
|
Loading…
Reference in New Issue