From 5000df5691982409c1f6daafbf86b19b444fa0a7 Mon Sep 17 00:00:00 2001 From: Benno Date: Wed, 8 Jan 2025 21:07:04 +0100 Subject: [PATCH] Some remaining renamings (see what I did there?) --- spybot/migrations/0001_initial.py | 14 +++++++------- spybot/models.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spybot/migrations/0001_initial.py b/spybot/migrations/0001_initial.py index dcbf685..600e2c3 100644 --- a/spybot/migrations/0001_initial.py +++ b/spybot/migrations/0001_initial.py @@ -58,8 +58,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(primary_key=True, serialize=False)), ('name', models.CharField(blank=True, max_length=128, null=True)), - ('client_id', models.PositiveIntegerField(db_column='clientID')), - ('online', models.BooleanField(db_column='isCurrentlyOnline', default=False)), + ('client_id', models.PositiveIntegerField(db_column='clientid')), + ('online', models.BooleanField(db_column='iscurrentlyonline', default=False)), ('merged_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tsusers', to=settings.AUTH_USER_MODEL)), ], options={ @@ -84,7 +84,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='TSID', fields=[ - ('ts_id', models.CharField(db_column='tsID', max_length=32, primary_key=True, serialize=False)), + ('ts_id', models.CharField(db_column='tsid', max_length=32, primary_key=True, serialize=False)), ('tsuser', models.ForeignKey(blank=True, db_column='tsuserid', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tsuser')), ], options={ @@ -154,11 +154,11 @@ class Migration(migrations.Migration): name='TSUserActivity', fields=[ ('id', models.IntegerField(primary_key=True, serialize=False)), - ('start_time', models.DateTimeField(blank=True, db_column='startTime', null=True)), - ('end_time', models.DateTimeField(blank=True, db_column='endTime', null=True)), + ('start_time', models.DateTimeField(blank=True, db_column='starttime', null=True)), + ('end_time', models.DateTimeField(blank=True, db_column='endtime', null=True)), ('joined', models.BooleanField(default=False)), - ('disconnect_id', models.IntegerField(blank=True, db_column='discID', null=True)), - ('channel', models.ForeignKey(db_column='cID', on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tschannel')), + ('disconnect_id', models.IntegerField(blank=True, db_column='discid', null=True)), + ('channel', models.ForeignKey(db_column='cid', on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tschannel')), ('tsuser', models.ForeignKey(blank=True, db_column='tsuserid', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tsuser')), ], options={ diff --git a/spybot/models.py b/spybot/models.py index e01d12a..5ccdeaf 100644 --- a/spybot/models.py +++ b/spybot/models.py @@ -117,9 +117,9 @@ class SteamID(DebuggableModel): class TSUser(DebuggableModel): id = AutoField(primary_key=True) name = models.CharField(max_length=128, blank=True, null=True) - client_id = models.PositiveIntegerField(db_column="clientID") + client_id = models.PositiveIntegerField(db_column="clientid") # maybe remove - online = models.BooleanField(db_column='isCurrentlyOnline', default=False) + online = models.BooleanField(db_column='iscurrentlyonline', default=False) merged_user = models.ForeignKey(MergedUser, on_delete=models.SET_NULL, null=True, related_name="tsusers") class Meta: @@ -132,7 +132,7 @@ def last_login_time(self): class TSID(DebuggableModel): tsuser = models.ForeignKey(TSUser, models.DO_NOTHING, db_column='tsuserid', blank=True, null=True) - ts_id = models.CharField(db_column='tsID', max_length=32, primary_key=True) + ts_id = models.CharField(db_column='tsid', max_length=32, primary_key=True) class Meta: managed = True @@ -142,11 +142,11 @@ class Meta: class TSUserActivity(DebuggableModel): id = models.IntegerField(primary_key=True, null=False) tsuser = models.ForeignKey(TSUser, models.DO_NOTHING, db_column='tsuserid', blank=True, null=True) # Field name made lowercase. - start_time = models.DateTimeField(db_column='startTime', blank=True, null=True) # Field name made lowercase. - end_time = models.DateTimeField(db_column='endTime', blank=True, null=True) # Field name made lowercase. + start_time = models.DateTimeField(db_column='starttime', blank=True, null=True) # Field name made lowercase. + end_time = models.DateTimeField(db_column='endtime', blank=True, null=True) # Field name made lowercase. joined = models.BooleanField(null=False, default=False) - disconnect_id = models.IntegerField(db_column='discID', blank=True, null=True) # Field name made lowercase. - channel = models.ForeignKey(TSChannel, models.DO_NOTHING, db_column='cID') # Field name made lowercase. + disconnect_id = models.IntegerField(db_column='discid', blank=True, null=True) # Field name made lowercase. + channel = models.ForeignKey(TSChannel, models.DO_NOTHING, db_column='cid') # Field name made lowercase. class Meta: managed = True