# Generated by Django 4.1.4 on 2022-12-18 18:10

from django.db import migrations, models
from django.utils.crypto import get_random_string


COUNT = 1000


def create_data(apps, schema_editor):
	db_alias = schema_editor.connection.alias
	Random = apps.get_model('web.Random')
	if Random.objects.using(db_alias).exists():
		return
	to_create = [Random(name=get_random_string(length=20)) for __ in range(COUNT)]
	Random.objects.using(db_alias).bulk_create(to_create)


class Migration(migrations.Migration):

	initial = True

	dependencies = [
	]

	operations = [
		migrations.CreateModel(
			name='Random',
			fields=[
				('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('name', models.CharField(max_length=50)),
			],
			options={
				'ordering': ('pk',),
			},
		),
		migrations.RunPython(create_data, migrations.RunPython.noop)
	]
