Skip to content

Commit

Permalink
Merge pull request #141 from SmoFlaDru/dev-benno
Browse files Browse the repository at this point in the history
Adapt table names to lowercase for postgres migration
  • Loading branch information
Bensge authored Jan 8, 2025
2 parents 52484bb + c2fcc41 commit 168f3d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions spybot/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Migration(migrations.Migration):
('order', models.PositiveIntegerField()),
],
options={
'db_table': 'TSChannel',
'db_table': 'tschannel',
'managed': True,
},
),
Expand All @@ -63,7 +63,7 @@ class Migration(migrations.Migration):
('merged_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tsusers', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'TSUser',
'db_table': 'tsuser',
'managed': True,
},
),
Expand All @@ -88,7 +88,7 @@ class Migration(migrations.Migration):
('tsuser', models.ForeignKey(blank=True, db_column='tsUserID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tsuser')),
],
options={
'db_table': 'TSID',
'db_table': 'tsid',
'managed': True,
},
),
Expand Down Expand Up @@ -133,7 +133,7 @@ class Migration(migrations.Migration):
('activity_hours', models.FloatField()),
],
options={
'db_table': 'HourlyActivity',
'db_table': 'hourlyactivity',
'indexes': [models.Index(fields=['datetime'], name='HourlyActiv_datetim_96f0af_idx')],
},
),
Expand Down Expand Up @@ -162,7 +162,7 @@ class Migration(migrations.Migration):
('tsuser', models.ForeignKey(blank=True, db_column='tsUserID', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='spybot.tsuser')),
],
options={
'db_table': 'TSUserActivity',
'db_table': 'tsuseractivity',
'managed': True,
'indexes': [models.Index(fields=['start_time'], name='TSUserActiv_startTi_95ea75_idx')],
},
Expand Down
10 changes: 5 additions & 5 deletions spybot/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TSChannel(DebuggableModel):

class Meta:
managed = True
db_table = 'TSChannel'
db_table = 'tschannel'


# Django doesn't have an unsigned int auto (auto-incremented) field type natively, so we provide our own
Expand Down Expand Up @@ -124,7 +124,7 @@ class TSUser(DebuggableModel):

class Meta:
managed = True
db_table = 'TSUser'
db_table = 'tsuser'

def last_login_time(self):
return getattr(TSUserActivity.objects.filter(tsuser=self, end_time__isnull=False).order_by('-end_time').first(), 'end_time', None)
Expand All @@ -136,7 +136,7 @@ class TSID(DebuggableModel):

class Meta:
managed = True
db_table = 'TSID'
db_table = 'tsid'


class TSUserActivity(DebuggableModel):
Expand All @@ -150,7 +150,7 @@ class TSUserActivity(DebuggableModel):

class Meta:
managed = True
db_table = 'TSUserActivity'
db_table = 'tsuseractivity'
indexes = [
models.Index(fields=['start_time'])
]
Expand All @@ -161,7 +161,7 @@ class HourlyActivity(DebuggableModel):
activity_hours = models.FloatField(null=False)

class Meta:
db_table = 'HourlyActivity'
db_table = 'hourlyactivity'
indexes = [
models.Index(fields=['datetime']),
]
Expand Down

0 comments on commit 168f3d0

Please sign in to comment.