mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 15:29:36 +02:00
commit
a656889905
3 changed files with 80 additions and 12 deletions
|
@ -0,0 +1,43 @@
|
|||
# Generated by Django 5.0.8 on 2024-08-11 12:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('adventures', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='adventure',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='checklist',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='checklistitem',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='collection',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='note',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='transportation',
|
||||
old_name='id',
|
||||
new_name='temp_id',
|
||||
),
|
||||
]
|
|
@ -32,8 +32,8 @@ User = get_user_model()
|
|||
|
||||
|
||||
class Adventure(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
#id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
type = models.CharField(max_length=100, choices=ADVENTURE_TYPES)
|
||||
|
@ -64,8 +64,8 @@ class Adventure(models.Model):
|
|||
return self.name
|
||||
|
||||
class Collection(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
#id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
name = models.CharField(max_length=200)
|
||||
|
@ -89,8 +89,8 @@ class Collection(models.Model):
|
|||
return self.name
|
||||
|
||||
class Transportation(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
#id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
type = models.CharField(max_length=100, choices=TRANSPORTATION_TYPES)
|
||||
|
@ -118,8 +118,8 @@ class Transportation(models.Model):
|
|||
return self.name
|
||||
|
||||
class Note(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
#id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
name = models.CharField(max_length=200)
|
||||
|
@ -142,8 +142,8 @@ class Note(models.Model):
|
|||
return self.name
|
||||
|
||||
class Checklist(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
# id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
name = models.CharField(max_length=200)
|
||||
|
@ -164,8 +164,8 @@ class Checklist(models.Model):
|
|||
return self.name
|
||||
|
||||
class ChecklistItem(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=True, unique=True, null=True, blank=True)
|
||||
#id = models.AutoField(primary_key=True)
|
||||
temp_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
||||
user_id = models.ForeignKey(
|
||||
User, on_delete=models.CASCADE, default=default_user_id)
|
||||
name = models.CharField(max_length=200)
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
# Generated by Django 5.0.8 on 2024-08-11 12:59
|
||||
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0003_remove_customuser_id_customuser_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='customuser',
|
||||
name='id',
|
||||
field=models.BigAutoField(auto_created=True, default=None, primary_key=True, serialize=False, verbose_name='ID'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customuser',
|
||||
name='uuid',
|
||||
field=models.UUIDField(blank=True, default=uuid.uuid4, null=True, unique=True),
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue