env changes

This commit is contained in:
workhardbekind 2025-10-26 22:11:40 -04:00
parent 7caf7c7e93
commit 68d3328e8e
1417 changed files with 1208 additions and 2 deletions

View file

View file

@ -0,0 +1,74 @@
# Generated by Django 5.2.7 on 2025-10-26 18:22
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ActivityGoal',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=60)),
('metric', models.CharField(choices=[('min', 'Time (Minutes)'), ('num', 'Number of times (x)'), ('kcal', 'Calories (Kcal)'), ('km', 'Distance (Km)'), ('kj', 'Effort (Kilojoules)')], max_length=4)),
('goal', models.DecimalField(decimal_places=2, max_digits=10)),
('period', models.CharField(choices=[('day', 'daily'), ('week', 'weekly'), ('month', 'monthly'), ('year', 'yearly'), ('competition', 'competition end')], default='day', max_length=12)),
('count_steps_as_walks', models.BooleanField(default=True)),
('min_per_workout', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('max_per_workout', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('min_per_day', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('max_per_day', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('min_per_week', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('max_per_week', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
],
),
migrations.CreateModel(
name='Award',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=60)),
('sport', models.CharField(choices=[('GROUP_ANY', 'Group: All Sports'), ('GROUP_RUNNING', 'Group: Running (Run / Trail / Treadmill)'), ('GROUP_BIKING', 'Group: Biking/Cycling (Except E-Bike)'), ('GROUP_WALKING', 'Group: Walking (Walk / Wheelchair / Elliptical / Stepper)'), ('GROUP_RACKET', 'Group: Racket Sports (Tennis / Squash / Badminton / Pickleball / Racquetball / Table Tennis)'), ('GROUP_SOCIAL', 'Group: Social Sports (Soccer / Golf)'), ('GROUP_CLASSES_CARDIO', 'Group: Cardio Gym Classes (Crossfit / HIIT)'), ('GROUP_CLASSES_MINDFUL', 'Group: Mindfulness Classes (Yoga / Pilates)'), ('GROUP_WATER_ACTIVE', 'Group: Active Water Sports (Swim / Canoe / Kayak / Kitesurf / Rowing / Surfing / Windsurf)'), ('Steps', 'Total Daily Steps'), ('Badminton', 'Badminton'), ('Ride', 'Biking/Cycling'), ('EBikeRide', 'Biking/Cycling (E-Bike)'), ('GravelRide', 'Biking/Cycling (Gravel)'), ('Handcycle', 'Biking/Cycling (Handcycle)'), ('Velomobile', 'Biking/Cycling (Velomobile)'), ('VirtualRide', 'Biking/Cycling (Virtual)'), ('Canoeing', 'Canoe'), ('Crossfit', 'Crossfit'), ('Elliptical', 'Elliptical'), ('Golf', 'Golf'), ('HighIntensityIntervalTraining', 'High Intensity Interval Training (HIIT)'), ('Hike', 'Hike'), ('IceSkate', 'Ice Skate'), ('InlineSkate', 'Inline Skate'), ('Kayaking', 'Kayak'), ('Kitesurf', 'Kitesurf'), ('MountainBikeRide', 'Mountain-Biking/Cycling'), ('EMountainBikeRide', 'Mountain-Biking/Cycling (E-Bike)'), ('Pickleball', 'Pickleball'), ('Pilates', 'Pilates'), ('Racquetball', 'Racquetball'), ('RockClimbing', 'Rock Climbing'), ('Rowing', 'Rowing (Outdoor)'), ('VirtualRow', 'Rowing (Virtual)'), ('Run', 'Run'), ('TrailRun', 'Run (Trail)'), ('VirtualRun', 'Run (Treadmill / Vitual)'), ('Sail', 'Sail'), ('Skateboard', 'Skateboard'), ('AlpineSki', 'Ski (Alpine)'), ('BackcountrySki', 'Ski (Backcountry)'), ('NordicSki', 'Ski (Nordic)'), ('RollerSki', 'Ski (Roller/Inliner)'), ('Snowboard', 'Snowboard'), ('Soccer', 'Soccer / Football'), ('Squash', 'Squash'), ('StairStepper', 'Stair Stepper'), ('StandUpPaddling', 'Stand-up Paddling'), ('Surfing', 'Surf'), ('Swim', 'Swim'), ('TableTennis', 'Table Tennis'), ('Tennis', 'Tennis'), ('Walk', 'Walk'), ('Snowshoe', 'Walk (Snowshoe)'), ('WeightTraining', 'Weight Training'), ('Wheelchair', 'Wheelchair'), ('Windsurf', 'Windsurf'), ('Yoga', 'Yoga'), ('Workout', 'Other Workout')], default='GROUP_ANY', max_length=40)),
('threshold', models.DecimalField(decimal_places=2, max_digits=10)),
('period', models.CharField(choices=[('day', 'daily'), ('week', 'weekly'), ('month', 'monthly'), ('year', 'yearly'), ('competition', 'competition end')], default='day', max_length=12)),
('reward_points', models.IntegerField()),
],
),
migrations.CreateModel(
name='Competition',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=60)),
('start_date', models.DateField()),
('end_date', models.DateField()),
('has_teams', models.BooleanField(default=False)),
('organizer_assigns_teams', models.BooleanField(default=False)),
('join_code', models.CharField(max_length=20, unique=True, validators=[django.core.validators.MinLengthValidator(10), django.core.validators.RegexValidator('^[a-zA-Z0-9]+$', message='Only letters and numbers allowed')])),
],
),
migrations.CreateModel(
name='Points',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('points_raw', models.DecimalField(decimal_places=2, max_digits=10)),
('points_capped', models.DecimalField(decimal_places=2, max_digits=10, null=True)),
],
options={
'verbose_name': 'Points',
'verbose_name_plural': 'Points',
},
),
migrations.CreateModel(
name='Team',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=60)),
],
),
]

View file

@ -0,0 +1,58 @@
# Generated by Django 5.2.7 on 2025-10-26 18:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('competition', '0001_initial'),
('workouts', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='competition',
name='owner',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='award',
name='competition',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='competition.competition'),
),
migrations.AddField(
model_name='activitygoal',
name='competition',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='competition.competition'),
),
migrations.AddField(
model_name='points',
name='award',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='competition.award'),
),
migrations.AddField(
model_name='points',
name='goal',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='competition.activitygoal'),
),
migrations.AddField(
model_name='points',
name='workout',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='workouts.workout'),
),
migrations.AddField(
model_name='team',
name='competition',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='competition.competition'),
),
migrations.AddConstraint(
model_name='points',
constraint=models.UniqueConstraint(fields=('goal', 'award', 'workout'), name='unique_goal_award_workout'),
),
]

View file

View file

@ -0,0 +1,67 @@
# Generated by Django 5.2.7 on 2025-10-26 18:22
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('competition', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CustomUser',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
('first_name', models.CharField(max_length=30)),
('last_name', models.CharField(blank=True, max_length=40, null=True)),
('gender', models.CharField(blank=True, choices=[('M', 'Male'), ('F', 'Female'), ('O', 'Other')], max_length=1, null=True)),
('username', models.CharField(blank=True, max_length=40, null=True)),
('goal_active_days', models.IntegerField(blank=True, default=3, null=True)),
('goal_workout_minutes', models.IntegerField(blank=True, default=150, null=True)),
('goal_distance', models.IntegerField(blank=True, default=None, null=True)),
('scaling_kcal', models.DecimalField(decimal_places=4, default=1, max_digits=8, validators=[django.core.validators.MinValueValidator(Decimal('0.6666')), django.core.validators.MaxValueValidator(Decimal('1.3333'))])),
('scaling_distance', models.DecimalField(decimal_places=4, default=1, max_digits=8, validators=[django.core.validators.MinValueValidator(Decimal('0.6666')), django.core.validators.MaxValueValidator(Decimal('1.3333'))])),
('is_verified', models.BooleanField(default=False)),
('email_mid_week', models.BooleanField(default=False)),
('strava_athlete_id', models.IntegerField(blank=True, null=True)),
('strava_allow_follow', models.BooleanField(default=True)),
('strava_refresh_token', models.CharField(blank=True, max_length=40, null=True)),
('strava_last_synced_at', models.DateTimeField(blank=True, null=True)),
('is_staff', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=True)),
('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('my_competitions', models.ManyToManyField(blank=True, related_name='user', to='competition.competition')),
('my_teams', models.ManyToManyField(blank=True, related_name='user', to='competition.team')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'User',
'verbose_name_plural': 'Users',
},
),
migrations.CreateModel(
name='RecalcRequest',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('start_datetime', models.DateTimeField()),
('done', models.BooleanField(default=False)),
('goal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='competition.activitygoal')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

View file

View file

@ -0,0 +1,33 @@
# Generated by Django 5.2.7 on 2025-10-26 18:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Workout',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sport_type', models.CharField(choices=[('Steps', 'Total Daily Steps'), ('Badminton', 'Badminton'), ('Ride', 'Biking/Cycling'), ('EBikeRide', 'Biking/Cycling (E-Bike)'), ('GravelRide', 'Biking/Cycling (Gravel)'), ('Handcycle', 'Biking/Cycling (Handcycle)'), ('Velomobile', 'Biking/Cycling (Velomobile)'), ('VirtualRide', 'Biking/Cycling (Virtual)'), ('Canoeing', 'Canoe'), ('Crossfit', 'Crossfit'), ('Elliptical', 'Elliptical'), ('Golf', 'Golf'), ('HighIntensityIntervalTraining', 'High Intensity Interval Training (HIIT)'), ('Hike', 'Hike'), ('IceSkate', 'Ice Skate'), ('InlineSkate', 'Inline Skate'), ('Kayaking', 'Kayak'), ('Kitesurf', 'Kitesurf'), ('MountainBikeRide', 'Mountain-Biking/Cycling'), ('EMountainBikeRide', 'Mountain-Biking/Cycling (E-Bike)'), ('Pickleball', 'Pickleball'), ('Pilates', 'Pilates'), ('Racquetball', 'Racquetball'), ('RockClimbing', 'Rock Climbing'), ('Rowing', 'Rowing (Outdoor)'), ('VirtualRow', 'Rowing (Virtual)'), ('Run', 'Run'), ('TrailRun', 'Run (Trail)'), ('VirtualRun', 'Run (Treadmill / Vitual)'), ('Sail', 'Sail'), ('Skateboard', 'Skateboard'), ('AlpineSki', 'Ski (Alpine)'), ('BackcountrySki', 'Ski (Backcountry)'), ('NordicSki', 'Ski (Nordic)'), ('RollerSki', 'Ski (Roller/Inliner)'), ('Snowboard', 'Snowboard'), ('Soccer', 'Soccer / Football'), ('Squash', 'Squash'), ('StairStepper', 'Stair Stepper'), ('StandUpPaddling', 'Stand-up Paddling'), ('Surfing', 'Surf'), ('Swim', 'Swim'), ('TableTennis', 'Table Tennis'), ('Tennis', 'Tennis'), ('Walk', 'Walk'), ('Snowshoe', 'Walk (Snowshoe)'), ('WeightTraining', 'Weight Training'), ('Wheelchair', 'Wheelchair'), ('Windsurf', 'Windsurf'), ('Yoga', 'Yoga'), ('Workout', 'Other Workout')], max_length=40)),
('start_datetime', models.DateTimeField()),
('duration', models.DurationField()),
('intensity_category', models.IntegerField(choices=[(1, 'Easy (Could do another one later today)'), (2, 'Moderate (Done for today but tomorrow is a new day)'), (3, 'Hard (Will definitely feel this workout tomorrow)'), (4, "All Out (Can't do another one tomorrow)")], null=True)),
('kcal', models.DecimalField(decimal_places=2, max_digits=7, null=True)),
('distance', models.DecimalField(decimal_places=2, max_digits=7, null=True)),
('steps', models.IntegerField(null=True)),
('strava_id', models.BigIntegerField(null=True, unique=True)),
('strava_intensity_avg_watts', models.DecimalField(decimal_places=2, max_digits=7, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

View file