-
Notifications
You must be signed in to change notification settings - Fork 5
/
historical_models_migration_instructions
56 lines (31 loc) · 1.28 KB
/
historical_models_migration_instructions
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
To implement this feature on a production database:
pip install django-simple-history
migrate to
python manage.py migrate neuroelectro 0004
git reset 1e32c41e2ab8f752ee283b493e3de76cab5983fc
python manage.py shell
import dbrestore
dbrestore.make_unique_dt_ids()
python manage.py migrate neuroelectro 0002
python manage.py migrate neuroelectro 0004
python manage.py populate_history --auto
python manage.py shell
import dbrestore
dbrestore.update_concept_map_histories()
run terminal command to output json for user validation fields on concept map objects: python manage.py dumpdata neuroelectro.neuronconceptmap neuroelectro.ephysconceptmap neuroelectro.neuronephysdatamap neuroelectro.expfactconceptmap neuroelectro.user neuroelectro.uservalidation --indent 2 > concept_map_dump.json
git checkout django1.8
python manage.py migrate neuroelectro --fake-initial
git checkout curationhistory2
python manage.py shell
import dbrestore
dbrestore.fix_db_fields_pre_historical_records()
git checkout curationhistory3
# add migrations for historical records
python manage.py migrate neuroelectro
python manage.py populate_history --auto
python manage.py shell
import dbrestore
dbrestore.update_concept_map_histories()
exit
git checkout curationhistory4
python manage.py migrate neuroelectro