Skip to content
Snippets Groups Projects
Commit be333491 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix on db to update visit_number for existing entries

parent 7555a491
No related branches found
No related tags found
1 merge request!85subject list contain list of visits
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-27 10:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0056_visit_visit_number'),
]
operations = [
migrations.RunSQL(
"update web_visit s set visit_number= (select count(*) from web_visit t " +
"where t.subject_id=s.subject_id and t.datetime_begin<= s.datetime_begin);")
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment