forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0039_maintenancemode.py
More file actions
38 lines (29 loc) · 1.03 KB
/
0039_maintenancemode.py
File metadata and controls
38 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Generated by Django 4.2.26 on 2026-04-23 14:25
from django.db import migrations, models
def create_initial_record(apps, schema_editor):
MaintenanceMode = apps.get_model('osf', 'MaintenanceMode')
MaintenanceMode.objects.get_or_create(
pk=1,
defaults={'maintenance_mode': False}
)
def reverse_initial_record(apps, schema_editor):
# the reverse 'reverse_initial_record' does nothing
# because the table will be removed
pass
class Migration(migrations.Migration):
dependencies = [
('osf', '0038_abstractnode_date_last_indexed_and_more'),
]
operations = [
migrations.CreateModel(
name='MaintenanceMode',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('maintenance_mode', models.BooleanField(default=False)),
],
),
migrations.RunPython(
create_initial_record,
reverse_code=reverse_initial_record
),
]