Skip to content

Commit 9a88099

Browse files
authored
Merge pull request #61 from CodeForPhilly/listOfMed
List of med
2 parents 862872e + e3c570e commit 9a88099

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
# Generated by Django 4.2.3 on 2023-12-01 10:39
2-
31
from django.db import migrations
42

53

4+
def add_state_medication_data(apps, schema_editor):
5+
StateMedication = apps.get_model('api', 'StateMedication')
6+
7+
# Define your data
8+
state_medication_data = [
9+
{'state': 'mania', 'first': 'mania-first',
10+
'second': 'mania-second', 'third': 'mania-third'},
11+
{'state': 'hypomanic', 'first': 'hypomanic-first',
12+
'second': 'hypomanic-second', 'third': 'hypomanic-third'},
13+
{'state': 'depressed', 'first': 'depressed-first',
14+
'second': 'depressed-second', 'third': 'depressed-third'},
15+
{'state': 'euthymic', 'first': 'euthymic-first',
16+
'second': 'euthymic-second', 'third': 'euthymic-third'},
17+
]
18+
19+
# Insert the data into the StateMedication table
20+
for med in state_medication_data:
21+
StateMedication.objects.create(**med)
22+
23+
624
class Migration(migrations.Migration):
725

826
dependencies = [
927
('api', '0001_initial'),
1028
]
1129

1230
operations = [
31+
migrations.RunPython(add_state_medication_data),
1332
]

0 commit comments

Comments
 (0)