Пример #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('app1', '0005_auto_20160630_1721'),
    ]

    operations = [
        migrations.CreateModel(
            name='RewardPack',
            fields=[
                ('idPack', models.AutoField(primary_key=True, serialize=False)),
                ('packType', models.IntegerField(default=0)),
                ('unlockStartTime', models.IntegerField(default=-1)),
                ('packLeagueLevel', models.IntegerField(default=0)),
            ],
        ),
        migrations.RenameField(
            model_name='cardtype',
            old_name='name',
            new_name='cardName',
        ),
        migrations.AddField(
            model_name='cardtype',
            name='cardLeagueLevel',
            field=models.SmallIntegerField(default=0),
        ),
        migrations.AddField(
            model_name='cardtype',
            name='cardRarity',
            field=models.SmallIntegerField(choices=[(0, 'Common'), (1, 'Rare'), (2, 'Epic')], default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='kingHP',
            field=models.SmallIntegerField(default=200),
        ),
        migrations.AddField(
            model_name='user',
            name='leagueLevel',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='packCount',
            field=models.SmallIntegerField(default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='packCycle',
            field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=app1.models.default_pack_cycle, size=6),
        ),
        migrations.AddField(
            model_name='rewardpack',
            name='packUser',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rewardPacks', to='app1.User'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('app1', '0003_auto_20200721_1612'),
    ]

    operations = [
        migrations.CreateModel(
            name='D',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('meh', models.CharField(default=faker.providers.python.Provider.pystr, max_length=250)),
            ],
        ),
        migrations.AlterField(
            model_name='a',
            name='bla',
            field=models.CharField(default=faker.providers.python.Provider.pystr, max_length=250),
        ),
        migrations.AlterField(
            model_name='b',
            name='x',
            field=models.IntegerField(default=faker.providers.python.Provider.pyint),
        ),
        migrations.AlterField(
            model_name='c',
            name='title',
            field=models.CharField(default=faker.providers.python.Provider.pystr, max_length=250),
        ),
        migrations.AddField(
            model_name='c',
            name='d',
            field=models.ForeignKey(default=app1.models.new_d, on_delete=django.db.models.deletion.CASCADE, to='app1.D'),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app1', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Reader',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=16,
                                  unique=True,
                                  verbose_name='姓名')),
                ('phone', models.IntegerField(unique=True, verbose_name='电话')),
                ('max_borrowing',
                 models.IntegerField(default=5, verbose_name='可借数量')),
                ('balance', models.FloatField(default=0.0, verbose_name='余额')),
                ('photo',
                 models.ImageField(blank=True,
                                   upload_to=app1.models.custom_path,
                                   verbose_name='头像')),
                ('status',
                 models.IntegerField(choices=[(0, 'normal'), (-1, 'overdue')],
                                     default=0)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='读者')),
            ],
            options={
                'verbose_name': '读者',
                'verbose_name_plural': '读者',
            },
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Division',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=10, unique=True)),
                ('views', models.IntegerField(default=0)),
                ('slug', models.SlugField()),
            ],
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=10, unique=True)),
                ('views', models.IntegerField(default=0)),
                ('slug', models.SlugField()),
                ('likes', models.IntegerField(default=0)),
                ('images',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app1.models.desti)),
                ('division',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app1.Division')),
            ],
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('ISBN',
                 models.CharField(max_length=13,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ISBN')),
                ('title', models.CharField(max_length=128, verbose_name='书名')),
                ('author', models.CharField(max_length=32, verbose_name='作者')),
                ('press', models.CharField(max_length=64, verbose_name='出版社')),
                ('description',
                 models.CharField(default='',
                                  max_length=1024,
                                  verbose_name='详细')),
                ('price',
                 models.CharField(max_length=20, null=True,
                                  verbose_name='价格')),
                ('category',
                 models.CharField(default='文学',
                                  max_length=64,
                                  verbose_name='分类')),
                ('cover',
                 models.ImageField(blank=True,
                                   upload_to=app1.models.custom_path,
                                   verbose_name='封面')),
                ('index',
                 models.CharField(max_length=16, null=True,
                                  verbose_name='索引')),
                ('location',
                 models.CharField(default='图书馆1楼',
                                  max_length=64,
                                  verbose_name='位置')),
                ('quantity', models.IntegerField(default=1,
                                                 verbose_name='数量')),
            ],
            options={
                'verbose_name': '图书',
                'verbose_name_plural': '图书',
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app1', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Card',
            fields=[
                ('idCard', models.AutoField(primary_key=True, serialize=False)),
                ('cardLevel', models.SmallIntegerField(default=1)),
                ('cardCount', models.SmallIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='CardType',
            fields=[
                ('idCardType', models.AutoField(primary_key=True, serialize=False)),
                ('Cardid', models.IntegerField(db_index=True, null=True, unique=True)),
                ('name', models.CharField(max_length=40)),
            ],
        ),
        migrations.CreateModel(
            name='Clan',
            fields=[
                ('idClan', models.AutoField(primary_key=True, serialize=False)),
                ('clanName', models.CharField(max_length=30)),
                ('clanDescription', models.TextField(blank=True, max_length=140, null=True)),
                ('clanTag', models.CharField(blank=True, db_index=True, max_length=10, null=True, unique=True)),
                ('clanLocation', models.CharField(blank=True, max_length=30, null=True)),
                ('clanType', models.IntegerField(default=0)),
                ('clanMinimumTrophies', models.IntegerField(default=0)),
                ('clanScore', models.IntegerField(default=0)),
                ('totalDonation', models.IntegerField(default=0)),
                ('clanBadge', models.IntegerField(blank=True, default=0, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('idUser', models.AutoField(primary_key=True, serialize=False)),
                ('deviceID', models.CharField(blank=True, max_length=200, null=True)),
                ('username', models.CharField(blank=True, default='', max_length=40)),
                ('trophiesCount', models.IntegerField(default=0)),
                ('winCount', models.IntegerField(default=0)),
                ('loseCount', models.IntegerField(default=0)),
                ('deck1', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, default=app1.models.default_deck_gen, null=True, size=8)),
                ('xp', models.IntegerField(default=0)),
                ('level', models.IntegerField(default=0)),
                ('totalDonations', models.IntegerField(default=0)),
                ('gem', models.IntegerField(default=0)),
                ('gold', models.IntegerField(default=0)),
                ('basicUser', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserClanData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.IntegerField(choices=[(0, 'Member'), (1, 'Leader')], default=0)),
                ('donate_count', models.IntegerField(default=0)),
                ('lastRequestTime', models.IntegerField(default=0)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='clanData',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.UserClanData'),
        ),
        migrations.AddField(
            model_name='user',
            name='userCards',
            field=models.ManyToManyField(through='app1.Card', to='app1.CardType'),
        ),
        migrations.AddField(
            model_name='user',
            name='userClan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='users', to='app1.Clan'),
        ),
        migrations.AddField(
            model_name='card',
            name='cardType',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cards', to='app1.CardType'),
        ),
        migrations.AddField(
            model_name='card',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cards', to='app1.User'),
        ),
        migrations.AlterUniqueTogether(
            name='card',
            unique_together=set([('user', 'cardType')]),
        ),
        migrations.AlterIndexTogether(
            name='card',
            index_together=set([('user', 'cardType')]),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=32)),
                ('last_name', models.CharField(blank=True, max_length=32)),
                ('time',
                 models.CharField(choices=[('', 'Kliknij'), ('9:00', '9:00'),
                                           ('9:30', '9:30'),
                                           ('10:00', '10:00'),
                                           ('10:30', '10:30'),
                                           ('11:00', '11:00'),
                                           ('11:30', '11:30'),
                                           ('12:00', '12:00')],
                                  default='',
                                  max_length=32)),
                ('phone', models.CharField(max_length=13)),
                ('email', models.EmailField(max_length=254)),
                ('exact_time',
                 models.DateTimeField(auto_now_add=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookingDate',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('booking_date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='DateList',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Kayak',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('stock', models.IntegerField()),
                ('store', models.IntegerField()),
                ('type',
                 models.CharField(choices=[('Jednosoboy', 'Jednoosobwy'),
                                           ('Dwuosobowy', 'Dwuosobowy'),
                                           ('Trzyosobowy', 'Trzyosobowy')],
                                  max_length=32)),
                ('available', models.BooleanField()),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Route',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('distance', models.CharField(max_length=32)),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='TermKayaks',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quantity', models.PositiveIntegerField()),
                ('exact_time',
                 models.DateTimeField(auto_now_add=True, null=True)),
                ('booking',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='app1_term_bookings',
                                   to='app1.Booking')),
                ('kayak',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='app1_kayaks',
                                   to='app1.Kayak')),
            ],
        ),
        migrations.AddField(
            model_name='booking',
            name='booking_date',
            field=models.ForeignKey(
                default='',
                limit_choices_to=app1.models.booking_dates_limit,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='app1_booking_date',
                to='app1.BookingDate'),
        ),
        migrations.AddField(
            model_name='booking',
            name='route',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app1.Route'),
        ),
        migrations.AddField(
            model_name='booking',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='user_app1',
                to=settings.AUTH_USER_MODEL),
        ),
    ]