Beispiel #1
0
class Migration(migrations.Migration):
    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                create_dengue_global()
            ],
        )
    ]
Beispiel #2
0
class Migration(migrations.Migration):

    dependencies = [
        ("api", "0005_auto_20190610_0209"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=[
            migrations.CreateModel(
                name="Task",
                fields=[
                    (
                        "uuid",
                        models.CharField(
                            default=adjutant.tasks.models.hex_uuid,
                            max_length=32,
                            primary_key=True,
                            serialize=False,
                        ),
                    ),
                    ("hash_key", models.CharField(db_index=True,
                                                  max_length=64)),
                    ("ip_address", models.GenericIPAddressField()),
                    ("keystone_user", jsonfield.fields.JSONField(default={})),
                    (
                        "project_id",
                        models.CharField(db_index=True,
                                         max_length=64,
                                         null=True),
                    ),
                    ("approved_by", jsonfield.fields.JSONField(default={})),
                    ("task_type",
                     models.CharField(db_index=True, max_length=100)),
                    ("action_notes", jsonfield.fields.JSONField(default={})),
                    (
                        "cancelled",
                        models.BooleanField(db_index=True, default=False),
                    ),
                    ("approved",
                     models.BooleanField(db_index=True, default=False)),
                    (
                        "completed",
                        models.BooleanField(db_index=True, default=False),
                    ),
                    (
                        "created_on",
                        models.DateTimeField(
                            default=django.utils.timezone.now),
                    ),
                    ("approved_on", models.DateTimeField(null=True)),
                    ("completed_on", models.DateTimeField(null=True)),
                ],
                options={
                    "indexes": [],
                },
            ),
        ], ),
    ]
Beispiel #3
0
class Migration(migrations.Migration):
    dependencies = [
        ("utils", "0012_tag_ordering"),
        ("messaging", "0001_initial"),
        ("peering", "0083_move_email_to_messaging"),
    ]

    state_operations = [
        migrations.CreateModel(
            name="Email",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True,
                                                 null=True)),
                ("updated", models.DateTimeField(auto_now=True, null=True)),
                ("name", models.CharField(max_length=128)),
                ("template", models.TextField()),
                (
                    "jinja2_trim",
                    models.BooleanField(
                        default=False, help_text="Removes new line after tag"),
                ),
                (
                    "jinja2_lstrip",
                    models.BooleanField(
                        default=False,
                        help_text="Strips whitespaces before block"),
                ),
                ("comments", models.TextField(blank=True)),
                ("subject", models.CharField(max_length=512)),
                (
                    "tags",
                    taggit.managers.TaggableManager(
                        help_text="A comma-separated list of tags.",
                        through="utils.TaggedItem",
                        to="utils.Tag",
                        verbose_name="Tags",
                    ),
                ),
            ],
            options={
                "ordering": ["name"],
                "abstract": False
            },
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = False

    # This flag is used to decide whether to run this migration in a transaction or not.
    # By default we prefer to run in a transaction, but for migrations where you want
    # to `CREATE INDEX CONCURRENTLY` this needs to be set to False. Typically you'll
    # want to create an index concurrently when adding one to an existing table.
    atomic = True

    dependencies = [("sentry", "0076_alert_rules_disable_constraints")]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.AlterUniqueTogether(name="alertruleenvironment", unique_together=set()),
                migrations.RemoveField(model_name="alertruleenvironment", name="alert_rule"),
                migrations.RemoveField(model_name="alertruleenvironment", name="environment"),
                migrations.RemoveField(model_name="alertrulequerysubscription", name="alert_rule"),
                migrations.RemoveField(
                    model_name="alertrulequerysubscription", name="query_subscription"
                ),
                migrations.AlterUniqueTogether(
                    name="querysubscriptionenvironment", unique_together=set()
                ),
                migrations.RemoveField(
                    model_name="querysubscriptionenvironment", name="environment"
                ),
                migrations.RemoveField(
                    model_name="querysubscriptionenvironment", name="query_subscription"
                ),
                migrations.RemoveField(model_name="alertrule", name="aggregation"),
                migrations.RemoveField(model_name="alertrule", name="dataset"),
                migrations.RemoveField(model_name="alertrule", name="environment"),
                migrations.RemoveField(model_name="alertrule", name="query"),
                migrations.RemoveField(model_name="alertrule", name="query_subscriptions"),
                migrations.RemoveField(model_name="alertrule", name="resolution"),
                migrations.RemoveField(model_name="alertrule", name="time_window"),
                migrations.RemoveField(model_name="querysubscription", name="aggregation"),
                migrations.RemoveField(model_name="querysubscription", name="dataset"),
                migrations.RemoveField(model_name="querysubscription", name="environments"),
                migrations.RemoveField(model_name="querysubscription", name="query"),
                migrations.RemoveField(model_name="querysubscription", name="resolution"),
                migrations.RemoveField(model_name="querysubscription", name="time_window"),
                migrations.DeleteModel(name="AlertRuleEnvironment"),
                migrations.DeleteModel(name="AlertRuleQuerySubscription"),
                migrations.DeleteModel(name="QuerySubscriptionEnvironment"),
            ]
        )
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    dependencies = [
        ("flow", "0002_set_process_owners"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.CreateModel(
                    name="DataDependency",
                    fields=[
                        (
                            "id",
                            models.AutoField(
                                auto_created=True,
                                primary_key=True,
                                serialize=False,
                                verbose_name="ID",
                            ),
                        ),
                    ],
                    options={
                        "db_table": "flow_data_parents",
                    },
                ),
                migrations.AlterField(
                    model_name="data",
                    name="parents",
                    field=models.ManyToManyField(
                        related_name="children",
                        through="flow.DataDependency",
                        to="flow.Data",
                    ),
                ),
                migrations.AddField(
                    model_name="datadependency",
                    name="child",
                    field=models.ForeignKey(
                        db_column="from_data_id",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="flow.Data",
                    ),
                ),
                migrations.AddField(
                    model_name="datadependency",
                    name="parent",
                    field=models.ForeignKey(
                        db_column="to_data_id",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="flow.Data",
                    ),
                ),
            ]
        )
    ]
class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = True

    # This flag is used to decide whether to run this migration in a transaction or not.
    # By default we prefer to run in a transaction, but for migrations where you want
    # to `CREATE INDEX CONCURRENTLY` this needs to be set to False. Typically you'll
    # want to create an index concurrently when adding one to an existing table.
    # You'll also usually want to set this to `False` if you're writing a data
    # migration, since we don't want the entire migration to run in one long-running
    # transaction.
    atomic = False

    dependencies = [
        ("sentry", "0216_cdc_setup_replication_index"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.AlterField(
                    model_name="projectdebugfile",
                    name="project",
                    field=sentry.db.models.fields.foreignkey.
                    FlexibleForeignKey(
                        db_constraint=False,
                        null=True,
                        to="sentry.Project",
                    ),
                )
            ],
            state_operations=[
                migrations.AddField(
                    model_name="projectdebugfile",
                    name="project_id",
                    field=sentry.db.models.fields.bounded.
                    BoundedBigIntegerField(null=True),
                ),
                migrations.RemoveField(
                    model_name="projectdebugfile",
                    name="project",
                ),
                migrations.AlterIndexTogether(
                    name="projectdebugfile",
                    index_together={("project_id", "code_id"),
                                    ("project_id", "debug_id")},
                ),
            ],
        )
    ]
Beispiel #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sbsong', '0005_song_watcher'),
        ('sbgig', '0004_moving_comments'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment_type',
                 models.CharField(choices=[('song_comment', 'song_comment'),
                                           ('gig_comment', 'gig_comment'),
                                           ('song_changed', 'song_changed')],
                                  max_length=20)),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('text', models.TextField()),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='comments',
                                   to=settings.AUTH_USER_MODEL)),
                ('gig',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='sbgig.Gig')),
                ('song',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='sbsong.Song')),
            ],
            options={
                'ordering': ['-datetime'],
            },
        ),
        migrations.AlterIndexTogether(
            name='comment',
            index_together=set([('gig', 'datetime'), ('song', 'datetime'),
                                ('author', 'datetime')]),
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('users', '0019_auto_20190304_1459'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='AccessKey',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='AccessKeyID')),
                ('secret',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  verbose_name='AccessKeySecret')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='access_keys',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='User')),
            ],
        ),
        migrations.CreateModel(
            name='PrivateToken',
            fields=[
                ('key',
                 models.CharField(max_length=40,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='Key')),
                ('created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='auth_token',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='User')),
            ],
            options={
                'verbose_name': 'Private Token',
            },
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
Beispiel #9
0
class Migration(migrations.Migration):

    dependencies = [
        ("examples", "0002_alter_example_project"),
        ("labels", "0005_alter_relation_project"),
        ("projects", "0002_auto_20220204_0201"),
        ("auto_labeling", "0004_alter_autolabelingconfig_project"),
        ("api", "0036_auto_20220204_0201"),
        ("label_types", "0003_auto_20220204_0201"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.DeleteModel(
                    name="ImageClassificationProject",
                ),
                migrations.DeleteModel(
                    name="IntentDetectionAndSlotFillingProject",
                ),
                migrations.DeleteModel(
                    name="Project",
                ),
                migrations.DeleteModel(
                    name="Seq2seqProject",
                ),
                migrations.DeleteModel(
                    name="SequenceLabelingProject",
                ),
                migrations.DeleteModel(
                    name="Speech2textProject",
                ),
                migrations.DeleteModel(
                    name="Tag",
                ),
                migrations.DeleteModel(
                    name="TextClassificationProject",
                ),
            ],
            database_operations=[
                migrations.AlterModelTable(
                    name="ImageClassificationProject", table="projects_imageclassificationproject"
                ),
                migrations.AlterModelTable(
                    name="IntentDetectionAndSlotFillingProject", table="projects_intentdetectionandslotfillingproject"
                ),
                migrations.AlterModelTable(name="Project", table="projects_project"),
                migrations.AlterModelTable(name="Seq2seqProject", table="projects_seq2seqproject"),
                migrations.AlterModelTable(name="SequenceLabelingProject", table="projects_sequencelabelingproject"),
                migrations.AlterModelTable(name="Speech2textProject", table="projects_speech2textproject"),
                migrations.AlterModelTable(name="Tag", table="projects_tag"),
                migrations.AlterModelTable(
                    name="TextClassificationProject", table="projects_textclassificationproject"
                ),
            ],
        )
    ]
Beispiel #10
0
class Migration(migrations.Migration):

    dependencies = [
        ('completion_aggregator', '0003_stalecompletion'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunSQL([(
                    "DROP TABLE IF EXISTS completion_aggregator_stalecompletionnew",
                    None)]),
                migrations.CreateModel(
                    name='StaleCompletionNew',
                    fields=[
                        ('id',
                         models.AutoField(auto_created=True,
                                          primary_key=True,
                                          serialize=False,
                                          verbose_name='ID')),
                        ('created',
                         model_utils.fields.AutoCreatedField(
                             default=django.utils.timezone.now,
                             editable=False,
                             verbose_name='created')),
                        ('modified',
                         model_utils.fields.AutoLastModifiedField(
                             default=django.utils.timezone.now,
                             editable=False,
                             verbose_name='modified')),
                        ('username', models.CharField(max_length=255)),
                        ('course_key',
                         opaque_keys.edx.django.models.CourseKeyField(
                             max_length=255)),
                        ('block_key',
                         opaque_keys.edx.django.models.UsageKeyField(
                             blank=True, max_length=255, null=True)),
                        ('force', models.BooleanField(default=False)),
                        ('resolved', models.BooleanField(default=False)),
                    ],
                ),
                migrations.AlterIndexTogether(
                    name='stalecompletionnew',
                    index_together=set([('username', 'course_key', 'created',
                                         'resolved')]),
                ),
                migrations.RunPython(copy_data)
            ],
            state_operations=[
                migrations.AlterIndexTogether(
                    name='stalecompletion',
                    index_together=set([('username', 'course_key', 'created',
                                         'resolved')]),
                )
            ],
        )
    ]
Beispiel #11
0
class Migration(migrations.Migration):

    dependencies = [
        ('ownership', '0023_auto_20150817_1133'),
        ('piece', '0014_auto_20150703_1111'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    state_operations = [
        migrations.CreateModel(
            name='ActionControl',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('acl_view', models.BooleanField(default=False)),
                ('acl_edit', models.BooleanField(default=False)),
                ('acl_download', models.BooleanField(default=False)),
                ('acl_delete', models.BooleanField(default=False)),
                ('acl_create_editions', models.BooleanField(default=False)),
                ('acl_view_editions', models.BooleanField(default=True)),
                ('acl_share', models.BooleanField(default=False)),
                ('acl_unshare', models.BooleanField(default=False)),
                ('acl_transfer', models.BooleanField(default=False)),
                ('acl_withdraw_transfer', models.BooleanField(default=False)),
                ('acl_consign', models.BooleanField(default=False)),
                ('acl_withdraw_consign', models.BooleanField(default=False)),
                ('acl_unconsign', models.BooleanField(default=False)),
                ('acl_request_unconsign', models.BooleanField(default=False)),
                ('acl_loan', models.BooleanField(default=False)),
                ('acl_coa', models.BooleanField(default=False)),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('edition',
                 models.ForeignKey(related_name='acl_at_edition',
                                   blank=True,
                                   to='piece.Edition',
                                   null=True)),
                ('piece',
                 models.ForeignKey(related_name='acl_at_piece',
                                   blank=True,
                                   to='piece.Piece',
                                   null=True)),
                ('user',
                 models.ForeignKey(related_name='acl_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('stores', '0027_auto_20171031_0942'),
    ]

    # Rename the database tables that refer to the models PickupDate,
    # PickupDateSeries and Feedback.
    database_operations = [
        migrations.AlterModelTable('pickupdate', 'pickups_pickupdate'),
        migrations.AlterModelTable('pickupdateseries',
                                   'pickups_pickupdateseries'),
        migrations.AlterModelTable('feedback', 'pickups_feedback'),
    ]

    # Delete the models PickupDate, PickupDateSeries and Feedback.
    # They will be re-created in the new pickups app.
    state_operations = [
        migrations.AlterUniqueTogether(
            name='feedback',
            unique_together=set([]),
        ),
        migrations.RemoveField(
            model_name='feedback',
            name='about',
        ),
        migrations.RemoveField(
            model_name='feedback',
            name='given_by',
        ),
        migrations.RemoveField(
            model_name='pickupdate',
            name='collectors',
        ),
        migrations.RemoveField(
            model_name='pickupdate',
            name='series',
        ),
        migrations.RemoveField(
            model_name='pickupdate',
            name='store',
        ),
        migrations.RemoveField(
            model_name='pickupdateseries',
            name='store',
        ),
        migrations.DeleteModel(name='Feedback', ),
        migrations.DeleteModel(name='PickupDate', ),
        migrations.DeleteModel(name='PickupDateSeries', ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=database_operations,
            state_operations=state_operations)
    ]
class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = True

    # This flag is used to decide whether to run this migration in a transaction or not.
    # By default we prefer to run in a transaction, but for migrations where you want
    # to `CREATE INDEX CONCURRENTLY` this needs to be set to False. Typically you'll
    # want to create an index concurrently when adding one to an existing table.
    # You'll also usually want to set this to `False` if you're writing a data
    # migration, since we don't want the entire migration to run in one long-running
    # transaction.
    atomic = False

    dependencies = [
        ("sentry", "0251_sentryappavatar_sentryapp_not_unique"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunPython(
                    delete_code_mappings_with_no_integration,
                    migrations.RunPython.noop,
                    hints={"tables": ["sentry_repositoryprojectpathconfig"]},
                ),
                migrations.AlterField(
                    model_name="repositoryprojectpathconfig",
                    name="organization_integration",
                    field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="sentry.OrganizationIntegration",
                        null=False,
                    ),
                ),
            ],
            state_operations=[
                migrations.AlterField(
                    model_name="repositoryprojectpathconfig",
                    name="organization_integration",
                    field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="sentry.OrganizationIntegration",
                        null=False,
                    ),
                )
            ],
        )
    ]
class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = True

    # This flag is used to decide whether to run this migration in a transaction or not.
    # By default we prefer to run in a transaction, but for migrations where you want
    # to `CREATE INDEX CONCURRENTLY` this needs to be set to False. Typically you'll
    # want to create an index concurrently when adding one to an existing table.
    # You'll also usually want to set this to `False` if you're writing a data
    # migration, since we don't want the entire migration to run in one long-running
    # transaction.
    atomic = False

    dependencies = [
        ("sentry", "0192_remove_fileblobowner_org_fk"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunSQL(
                    """
                    CREATE INDEX CONCURRENTLY IF NOT EXISTS sentry_grouprelease_group_id_first_seen_53fc35ds
                    ON sentry_grouprelease USING btree (group_id, first_seen);
                    """,
                    reverse_sql="""
                    DROP INDEX CONCURRENTLY IF EXISTS sentry_grouprelease_group_id_first_seen_53fc35ds;
                    """,
                ),
                migrations.RunSQL(
                    """
                    CREATE INDEX CONCURRENTLY IF NOT EXISTS sentry_grouprelease_group_id_last_seen_g8v2sk7c
                    ON sentry_grouprelease USING btree (group_id, last_seen DESC);
                    """,
                    reverse_sql="""
                    DROP INDEX CONCURRENTLY IF EXISTS sentry_grouprelease_group_id_last_seen_g8v2sk7c;
                    """,
                ),
            ],
            state_operations=[
                migrations.AlterIndexTogether(
                    name="grouprelease",
                    index_together={("group_id", "last_seen"),
                                    ("group_id", "first_seen")},
                ),
            ],
        )
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('applicant', '0004_added_location_state_code_and_location_country_code_models'),
        ('job_listing', '0007_move_job_listing_response_models_to_job_listing_response_app'),
        ('common', '0004_added_type_property_to_location_state_code_model'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='JobListingResponse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.TextField(max_length=100)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('updated_date', models.DateTimeField(auto_now=True, null=True)),
                ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='applicant.Applicant')),
                ('job_listing', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='job_listing.JobListing')),
            ],
            options={
                'db_table': 'job_listing_response_joblistingresponse'
            }
        ),
        migrations.CreateModel(
            name='JobListingResponseOutcome',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('outcome', models.TextField(max_length=100)),
                ('outcome_comments', models.TextField()),
                ('outcome_date', models.DateTimeField(auto_now_add=True)),
                ('job_listing_response', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='job_listing_response.JobListingResponse')),
            ],
            options={
                'db_table': 'job_listing_response_joblistingresponseoutcome'
            }
        ),
        migrations.CreateModel(
            name='JobListingResponseDocument',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('filename', models.TextField()),
                ('file_size', models.IntegerField()),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='common.File')),
                ('job_listing_response', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='job_listing_response.JobListingResponse')),
            ],
            options={
                'db_table': 'job_listing_response_joblistingresponsedocument'
            }
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
Beispiel #16
0
class Migration(migrations.Migration):

    dependencies = [
        ('places', '0027_auto_20171031_0942'),
    ]

    # Rename the database tables that refer to the models Activity,
    # ActivitySeries and Feedback.
    database_operations = [
        migrations.AlterModelTable('activity', 'activities_activity'),
        migrations.AlterModelTable('activityseries',
                                   'activities_activityseries'),
        migrations.AlterModelTable('feedback', 'activities_feedback'),
    ]

    # Delete the models Activity, ActivitySeries and Feedback.
    # They will be re-created in the new activities app.
    state_operations = [
        migrations.AlterUniqueTogether(
            name='feedback',
            unique_together=set([]),
        ),
        migrations.RemoveField(
            model_name='feedback',
            name='about',
        ),
        migrations.RemoveField(
            model_name='feedback',
            name='given_by',
        ),
        migrations.RemoveField(
            model_name='activity',
            name='participants',
        ),
        migrations.RemoveField(
            model_name='activity',
            name='series',
        ),
        migrations.RemoveField(
            model_name='activity',
            name='place',
        ),
        migrations.RemoveField(
            model_name='activityseries',
            name='place',
        ),
        migrations.DeleteModel(name='Feedback', ),
        migrations.DeleteModel(name='Activity', ),
        migrations.DeleteModel(name='ActivitySeries', ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=database_operations,
            state_operations=state_operations)
    ]
Beispiel #17
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0003_auto_20210211_1237'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('slug',
                 models.SlugField(help_text='Enter a URL-friendly name',
                                  unique=True)),
                ('last_edit', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(max_length=50)),
                ('summary',
                 models.TextField(blank=True, max_length=200, null=True)),
                ('date_posted',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('url',
                 models.URLField(help_text='Enter the video URL here',
                                 verbose_name='URL')),
                ('authors',
                 models.ManyToManyField(
                     related_name='videos_video_authors',
                     related_query_name='videos_video_author',
                     to=settings.AUTH_USER_MODEL)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='core.category')),
                ('tags',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Select some tags for this resource',
                     related_name='videos_video_tags',
                     related_query_name='videos_video_tag',
                     to='core.Tag')),
            ],
            options={
                'ordering': ['-date_posted'],
                'abstract': False,
            },
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
Beispiel #18
0
class Migration(migrations.Migration):

    dependencies = [
        ('wagtailredirects', '0005_capitalizeverbose'),
        ('wagtailcore', '0028_merge'),
        ('wagtailforms', '0003_capitalizeverbose'),
        ('core', '0031_auto_20160728_1315'),
    ]

    operations = [
        migrations.RunPython(forwards_func),
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.RemoveField(
                    model_name='author',
                    name='image',
                ),
                migrations.RemoveField(
                    model_name='blogindexpage',
                    name='listing_image',
                ),
                migrations.RemoveField(
                    model_name='blogindexpage',
                    name='page_ptr',
                ),
                migrations.RemoveField(
                    model_name='blogindexpage',
                    name='social_image',
                ),
                migrations.RemoveField(
                    model_name='blogpage',
                    name='author',
                ),
                migrations.RemoveField(
                    model_name='blogpage',
                    name='listing_image',
                ),
                migrations.RemoveField(
                    model_name='blogpage',
                    name='main_image',
                ),
                migrations.RemoveField(
                    model_name='blogpage',
                    name='page_ptr',
                ),
                migrations.RemoveField(
                    model_name='blogpage',
                    name='social_image',
                ),
                migrations.DeleteModel(name='Author', ),
                migrations.DeleteModel(name='BlogIndexPage', ),
                migrations.DeleteModel(name='BlogPage', ),
            ],
            database_operations=[],
        )
    ]
Beispiel #19
0
class Migration(migrations.Migration):

    dependencies = [
        ("results", "0001_squashed_0003_auto_20160608_1143"),
        ("people", "0006_auto_20160607_1400"),
    ]

    state_operations = [migrations.DeleteModel(name="School")]

    operations = [migrations.SeparateDatabaseAndState(state_operations=state_operations)]
class Migration(migrations.Migration):

    dependencies = [
        ('bot', '0003_auto_20190715_0138'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[migrations.DeleteModel(name='User')])
    ]
class Migration(migrations.Migration):
    dependencies = [
        ('ringapp', '0057_auto_20220430_1154'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=database_operations,
            state_operations=state_operations)
    ]
Beispiel #22
0
class Migration(migrations.Migration):

    dependencies = [
        ('exercise', '0006_auto_20150625_1823'),
        ('userprofile', '0002_auto_20150427_1717'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='DeadlineRuleDeviation',
            fields=[
                ('id',
                 models.AutoField(primary_key=True,
                                  serialize=False,
                                  auto_created=True,
                                  verbose_name='ID')),
                ('extra_minutes', models.IntegerField()),
                ('exercise', models.ForeignKey(to='exercise.BaseExercise')),
                ('submitter', models.ForeignKey(to='userprofile.UserProfile')),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model, ),
        ),
        migrations.CreateModel(
            name='MaxSubmissionsRuleDeviation',
            fields=[
                ('id',
                 models.AutoField(primary_key=True,
                                  serialize=False,
                                  auto_created=True,
                                  verbose_name='ID')),
                ('extra_submissions', models.IntegerField()),
                ('exercise', models.ForeignKey(to='exercise.BaseExercise')),
                ('submitter', models.ForeignKey(to='userprofile.UserProfile')),
            ],
            options={
                'abstract': False,
            },
            bases=(models.Model, ),
        ),
        migrations.AlterUniqueTogether(
            name='maxsubmissionsruledeviation',
            unique_together=set([('exercise', 'submitter')]),
        ),
        migrations.AlterUniqueTogether(
            name='deadlineruledeviation',
            unique_together=set([('exercise', 'submitter')]),
        ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations)
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('company', '0035_remove_account_manager_column'),
    ]

    operations = [
        migrations.AlterField(
            model_name='contact',
            name='contactable_by_dit',
            field=models.NullBooleanField(default=False),
        ),
        migrations.AlterField(
            model_name='contact',
            name='contactable_by_email',
            field=models.NullBooleanField(default=True),
        ),
        migrations.AlterField(
            model_name='contact',
            name='contactable_by_overseas_dit_partners',
            field=models.NullBooleanField(default=False),
        ),
        migrations.AlterField(
            model_name='contact',
            name='contactable_by_phone',
            field=models.NullBooleanField(default=True),
        ),
        migrations.AlterField(
            model_name='contact',
            name='contactable_by_uk_dit_partners',
            field=models.NullBooleanField(default=False),
        ),
        migrations.SeparateDatabaseAndState(state_operations=[
            migrations.RemoveField(
                model_name='contact',
                name='contactable_by_dit',
            ),
            migrations.RemoveField(
                model_name='contact',
                name='contactable_by_email',
            ),
            migrations.RemoveField(
                model_name='contact',
                name='contactable_by_overseas_dit_partners',
            ),
            migrations.RemoveField(
                model_name='contact',
                name='contactable_by_phone',
            ),
            migrations.RemoveField(
                model_name='contact',
                name='contactable_by_uk_dit_partners',
            ),
        ], ),
    ]
Beispiel #24
0
class Migration(migrations.Migration):
    # This flag is used to mark that a migration shouldn't be automatically run in
    # production. We set this to True for operations that we think are risky and want
    # someone from ops to run manually and monitor.
    # General advice is that if in doubt, mark your migration as `is_dangerous`.
    # Some things you should always mark as dangerous:
    # - Large data migrations. Typically we want these to be run manually by ops so that
    #   they can be monitored. Since data migrations will now hold a transaction open
    #   this is even more important.
    # - Adding columns to highly active tables, even ones that are NULL.
    is_dangerous = True
    # This flag is used to decide whether to run this migration in a transaction or not.
    # By default we prefer to run in a transaction, but for migrations where you want
    # to `CREATE INDEX CONCURRENTLY` this needs to be set to False. Typically you'll
    # want to create an index concurrently when adding one to an existing table.
    # You'll also usually want to set this to `False` if you're writing a data
    # migration, since we don't want the entire migration to run in one long-running
    # transaction.
    atomic = False
    dependencies = [
        ("sentry", "0199_release_semver"),
    ]
    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunSQL(
                    """
                    CREATE INDEX CONCURRENTLY IF NOT EXISTS "sentry_release_organization_id_status_3c637259_idx" ON "sentry_release" ("organization_id", "status");
                    """,
                    reverse_sql=
                    "DROP INDEX CONCURRENTLY IF EXISTS sentry_release_organization_id_status_3c637259_idx",
                ),
                migrations.RunSQL(
                    """
                    CREATE INDEX CONCURRENTLY IF NOT EXISTS "sentry_release_organization_id_date_added_8ebd273a_idx" ON "sentry_release" ("organization_id", "date_added");
                    """,
                    reverse_sql=
                    "DROP INDEX CONCURRENTLY IF EXISTS sentry_release_organization_id_date_added_8ebd273a_idx",
                ),
            ],
            state_operations=[
                migrations.AlterIndexTogether(
                    name="release",
                    index_together={
                        ("organization", "build_code"),
                        ("organization", "major", "minor", "patch",
                         "revision"),
                        ("organization", "build_number"),
                        ("organization", "status"),
                        ("organization", "date_added"),
                    },
                ),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('form_processor', '0082_migrate_delta_3_backfill_notnull'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(database_operations=[
            migrator.get_migration('migrate_delta_4_switch_columns.sql'),
        ]),
    ]
Beispiel #26
0
class Migration(migrations.Migration):

    dependencies = [
        ('form_processor', '0084_migrate_delta_5_alter_field'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(database_operations=[
            migrator.get_migration('migrate_balance_1_add_column.sql'),
        ]),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('form_processor', '0079_add_xmlns_index'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(database_operations=[
            migrator.get_migration('migrate_delta_1_add_column.sql'),
        ]),
    ]
Beispiel #28
0
class Migration(migrations.Migration):

    dependencies = [
        ('form_processor', '0086_migrate_balance_2_create_trigger'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(database_operations=[
            migrator.get_migration('migrate_balance_3_backfill_notnull.sql'),
        ]),
    ]
Beispiel #29
0
class Migration(migrations.Migration):

    dependencies = [
        ('wagtailsearchpromotions', '0002_capitalizeverbose'),
        ('wagtailforms', '0003_capitalizeverbose'),
        ('wagtailredirects', '0006_redirect_increase_max_length'),
        ('wagtailcore', '0040_page_draft_title'),
        ('torchbox', '0105_torchboximage_file_hash'),
    ]

    database_operations = [
        migrations.AlterModelTable('ServicePage', 'services_servicepage'),
        migrations.AlterModelTable('ServicesPage',
                                   'services_serviceindexpage'),
        migrations.AlterModelTable('ServicesPageService',
                                   'services_serviceindexpageservice'),
    ]

    state_operations = [
        migrations.RemoveField(
            model_name='servicepage',
            name='page_ptr',
        ),
        migrations.RemoveField(
            model_name='servicepage',
            name='particle',
        ),
        migrations.RemoveField(
            model_name='servicespage',
            name='main_image',
        ),
        migrations.RemoveField(
            model_name='servicespage',
            name='page_ptr',
        ),
        migrations.RemoveField(
            model_name='servicespageservice',
            name='link',
        ),
        migrations.RemoveField(
            model_name='servicespageservice',
            name='page',
        ),
        migrations.DeleteModel(name='ServicePage', ),
        migrations.DeleteModel(name='ServicesPage', ),
        migrations.DeleteModel(name='ServicesPageService', ),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=database_operations,
            state_operations=state_operations,
        )
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('form_processor', '0085_migrate_balance_1_add_column'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(database_operations=[
            migrator.get_migration('migrate_balance_2_create_trigger.sql'),
        ]),
    ]