File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Generated by Django 4.2.26 on 2026-05-22 14:57
2+ # Manually added `create_initial_record()`
23
34from django .db import migrations , models
45
56
7+ def create_initial_record (apps , schema_editor ):
8+ MaintenanceMode = apps .get_model ('osf' , 'MaintenanceMode' )
9+ MaintenanceMode .objects .get_or_create (
10+ pk = 1 ,
11+ defaults = {'maintenance_mode' : False }
12+ )
13+
14+
15+ def reverse_initial_record (apps , schema_editor ):
16+ # the reverse 'reverse_initial_record' does nothing
17+ # because the table will be removed
18+ pass
19+
20+
621class Migration (migrations .Migration ):
722
823 dependencies = [
@@ -17,4 +32,8 @@ class Migration(migrations.Migration):
1732 ('maintenance_mode' , models .BooleanField (default = False )),
1833 ],
1934 ),
35+ migrations .RunPython (
36+ create_initial_record ,
37+ reverse_code = reverse_initial_record
38+ ),
2039 ]
You can’t perform that action at this time.
0 commit comments