File tree 1 file changed +9
-7
lines changed
djangocms_text/migrations 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Generated by Django 3.2.25 on 2024-07-02 14:09
2
2
3
- from django .db import migrations , models , ProgrammingError
3
+ from django .db import migrations , models , OperationalError
4
4
5
5
6
6
def migrate_text_ckeditor_fields (apps , schema_editor ):
@@ -23,12 +23,14 @@ class Meta:
23
23
try :
24
24
existing_texts = Text_Text .objects .all ().values_list ("cmsplugin_ptr_id" , flat = True )
25
25
qs = CKEditorText .objects .using (schema_editor .connection .alias ).exclude (cmsplugin_ptr_id__in = existing_texts )
26
- except ProgrammingError :
27
- return
28
- Text_Text .objects .using (schema_editor .connection .alias ).bulk_create (
29
- Text_Text (body = ckeditor_text .body , rte = "text_ckeditor4" , cmsplugin_ptr_id = ckeditor_text .cmsplugin_ptr_id )
30
- for ckeditor_text in qs
31
- )
26
+ Text_Text .objects .using (schema_editor .connection .alias ).bulk_create (
27
+ Text_Text (body = ckeditor_text .body , rte = "text_ckeditor4" , cmsplugin_ptr_id = ckeditor_text .cmsplugin_ptr_id )
28
+ for ckeditor_text in qs
29
+ )
30
+ except OperationalError as e :
31
+ if "no such table" in str (e ):
32
+ return
33
+ raise e
32
34
33
35
34
36
class Migration (migrations .Migration ):
You can’t perform that action at this time.
0 commit comments