this provides character-level operations such as character creation, logging in/out, leveling them, and penalizing them. this isn't a game, yet, but it does implement and test a lot of the core functionality, just without triggers or bulk operations Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
62 lines
3.0 KiB
Python
62 lines
3.0 KiB
Python
# Generated by Django 5.0.4 on 2024-05-06 05:07
|
|
|
|
import django.db.models.deletion
|
|
import idlerpg.models
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('ircbot', '0020_alter_alias_id_alter_botuser_id_alter_ircchannel_id_and_more'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Game',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=30)),
|
|
('active', models.BooleanField(default=False)),
|
|
('channel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ircbot.ircchannel')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Character',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=16)),
|
|
('password', models.CharField(max_length=256)),
|
|
('hostmask', models.CharField(max_length=256)),
|
|
('status', models.CharField(choices=[('OFFLINE', 'Offline'), ('ONLINE', 'Online'), ('DISABLED', 'Disabled')], default='OFFLINE', max_length=8)),
|
|
('character_class', models.CharField(max_length=30)),
|
|
('level', models.PositiveIntegerField(default=0)),
|
|
('next_level', models.DateTimeField(default=idlerpg.models.Game.level_formula)),
|
|
('created', models.DateTimeField(auto_now_add=True)),
|
|
('last_login', models.DateTimeField(blank=True, null=True)),
|
|
('time_penalized_nick_change', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_part', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_quit', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_logout', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_kicked', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_privmsg', models.PositiveIntegerField(default=0)),
|
|
('time_penalized_notice', models.PositiveIntegerField(default=0)),
|
|
('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='idlerpg.game')),
|
|
],
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='game',
|
|
constraint=models.UniqueConstraint(models.F('active'), models.F('channel'), name='one_game_per_channel'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='character',
|
|
constraint=models.UniqueConstraint(models.F('game'), models.F('hostmask'), name='one_player_character_per_game'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='character',
|
|
constraint=models.UniqueConstraint(models.F('game'), models.F('name'), name='no_characters_with_same_name_per_game'),
|
|
),
|
|
]
|