<reponame>felipemaion/financial-management-gate-django<filename>backend/instrument/migrations/MESS/0018_auto_20200710_0941.py
# Generated by Django 3.0.3 on 2020-07-10 09:41

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('instrument', '0017_auto_20200710_0529'),
    ]

    operations = [
        migrations.CreateModel(
            name='EventoAcao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('ex_date', models.DateField(verbose_name='ex-date')),
                ('event_date', models.DateField(blank=True, null=True, verbose_name='payment date')),
                ('accounting_date', models.DateField(blank=True, null=True, verbose_name='accounting date')),
                ('category', models.CharField(max_length=20, verbose_name='category')),
                ('document_link', models.URLField(blank=True, max_length=250, null=True)),
                ('instrument', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events2', to='instrument.Instrument')),
                ('source_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Event',
                'verbose_name_plural': 'Events',
                'ordering': ['-ex_date'],
                'unique_together': {('instrument', 'ex_date', 'category')},
            },
        ),
        migrations.AlterModelOptions(
            name='dividend',
            options={'ordering': ['-ex_date'], 'verbose_name': 'Dividend', 'verbose_name_plural': 'Dividends'},
        ),
        # migrations.AlterUniqueTogether(
        #     name='dividend',
        #     unique_together=set(),
        # ),
        migrations.CreateModel(
            name='Event2',
            fields=[
                ('eventoacao_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='instrument.EventoAcao')),
                ('factor', models.DecimalField(decimal_places=9, max_digits=20, verbose_name='factor')),
            ],
            options={
                'verbose_name': 'Dividend',
                'verbose_name_plural': 'Dividends',
                'ordering': ['-ex_date'],
            },
            bases=('instrument.eventoacao',),
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='accounting_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='created_at',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='dividend_type',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='document_link',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='ex_dividend_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='id',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='instrument',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='payment_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='source_user',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='updated_at',
        ),
        migrations.AddField(
            model_name='dividend',
            name='eventoacao_ptr',
            field=models.OneToOneField(auto_created=True, default='', on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='instrument.EventoAcao'),
            preserve_default=False,
        ),
    ]

# Generated by Django 3.0.3 on 2020-07-10 09:41

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('instrument', '0017_auto_20200710_0529'),
    ]

    operations = [
        migrations.CreateModel(
            name='EventoAcao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('ex_date', models.DateField(verbose_name='ex-date')),
                ('event_date', models.DateField(blank=True, null=True, verbose_name='payment date')),
                ('accounting_date', models.DateField(blank=True, null=True, verbose_name='accounting date')),
                ('category', models.CharField(max_length=20, verbose_name='category')),
                ('document_link', models.URLField(blank=True, max_length=250, null=True)),
                ('instrument', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events2', to='instrument.Instrument')),
                ('source_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Event',
                'verbose_name_plural': 'Events',
                'ordering': ['-ex_date'],
                'unique_together': {('instrument', 'ex_date', 'category')},
            },
        ),
        migrations.AlterModelOptions(
            name='dividend',
            options={'ordering': ['-ex_date'], 'verbose_name': 'Dividend', 'verbose_name_plural': 'Dividends'},
        ),
        # migrations.AlterUniqueTogether(
        #     name='dividend',
        #     unique_together=set(),
        # ),
        migrations.CreateModel(
            name='Event2',
            fields=[
                ('eventoacao_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='instrument.EventoAcao')),
                ('factor', models.DecimalField(decimal_places=9, max_digits=20, verbose_name='factor')),
            ],
            options={
                'verbose_name': 'Dividend',
                'verbose_name_plural': 'Dividends',
                'ordering': ['-ex_date'],
            },
            bases=('instrument.eventoacao',),
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='accounting_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='created_at',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='dividend_type',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='document_link',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='ex_dividend_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='id',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='instrument',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='payment_date',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='source_user',
        ),
        migrations.RemoveField(
            model_name='dividend',
            name='updated_at',
        ),
        migrations.AddField(
            model_name='dividend',
            name='eventoacao_ptr',
            field=models.OneToOneField(auto_created=True, default='', on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='instrument.EventoAcao'),
            preserve_default=False,
        ),
    ]
# Generated by Django 3.0.3 on 2020-07-10 09:41 # migrations.AlterUniqueTogether( #     name='dividend', #     unique_together=set(), # ),