text: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.3 on 2018-05-29 12:55
  from __future__ import unicode_literals
  
  from django.db import migrations, models
  import datetime
  
  
  def transfer_year_of_birth(apps, schema_editor):
      # We can't import the Person model directly as it may be a newer
      # version than this migration expects. We use the historical version.
      Player = apps.get_model('players', 'Player')
      for player in Player.objects.all():
          player.birth_date = datetime.date(player.year_of_birth, 1, 1)
          player.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('players', '0005_auto_20180123_1901'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='player',
              name='birth_date',
              field=models.DateField(blank=True, help_text='Use the following format: DD.MM.YYYY', null=True, verbose_name='Birth Date'),
          ),
          migrations.RunPython(transfer_year_of_birth),
          migrations.RemoveField(
              model_name='player',
              name='year_of_birth',
          ),
      ]
  