Archived
Merging completed migrations #3
@@ -0,0 +1,45 @@
|
|||||||
|
[{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 1,
|
||||||
|
"fields": {
|
||||||
|
"image_tag_name": "landscape"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 2,
|
||||||
|
"fields": {
|
||||||
|
"image_tag_name": "portrait"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 3,
|
||||||
|
"fields":
|
||||||
|
{
|
||||||
|
"image_tag_name": "night"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 4,
|
||||||
|
"fields": {
|
||||||
|
"image_tag_name": "high key"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 5,
|
||||||
|
"fields": {
|
||||||
|
"image_tag_name": "family"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.image_tags",
|
||||||
|
"pk": 6,
|
||||||
|
"fields": {
|
||||||
|
"image_tag_name": "wedding"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"model": "smugfolioapi.smug_users",
|
||||||
|
"pk": 1,
|
||||||
|
"fields":
|
||||||
|
{
|
||||||
|
"business_name":"Going-to-the-Sun Photography",
|
||||||
|
"business_owner": true,
|
||||||
|
"user": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[{
|
||||||
|
"model": "authtoken.token",
|
||||||
|
"pk": "fa2eba9be8282d595c997ee5cd49f2ed31f65bed",
|
||||||
|
"fields": {
|
||||||
|
"user": 1,
|
||||||
|
"created": "2020-08-29T13:24:27.172Z"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"model": "auth.user",
|
||||||
|
"pk": 1,
|
||||||
|
"fields":
|
||||||
|
{
|
||||||
|
"first_name":"Ansel",
|
||||||
|
"last_name": "Adams",
|
||||||
|
"password":"pbkdf2_sha256$216000$qMRH8szID7Z8$Vljya2V3XfruOHuvx1hGz9ZyKg4bxbw7rc2WO0gTR7I=",
|
||||||
|
"is_superuser": true,
|
||||||
|
"username": "a.adams@goingtothesunphotography.com",
|
||||||
|
"email": "a.adams@goingtothesunphotography.com",
|
||||||
|
"is_staff": true,
|
||||||
|
"is_active":true,
|
||||||
|
"date_joined": "2022-03-14 12:00:00",
|
||||||
|
"last_login": "2022-03-14 12:00:00",
|
||||||
|
"groups": [],
|
||||||
|
"user_permissions": []
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# Generated by Django 4.0.3 on 2022-03-15 16:29
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Image_Tags',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('image_tag_name', models.CharField(max_length=256)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Smug_Users',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('business_name', models.CharField(max_length=256)),
|
||||||
|
('business_owner', models.BooleanField(default=False)),
|
||||||
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Images',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('file_name', models.CharField(max_length=1024)),
|
||||||
|
('file_path', models.CharField(max_length=1024)),
|
||||||
|
('album_id', models.IntegerField(default=0)),
|
||||||
|
('upload_date', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('smug_user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='smugfolioapi.smug_users')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Image_Tag_Assignments',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('image_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='smugfolioapi.images')),
|
||||||
|
('image_tag_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='smugfolioapi.image_tags')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
from smugfolioapi.models.image_tag_assignments import Image_Tag_Assignments
|
||||||
|
from smugfolioapi.models.image_tags import Image_Tags
|
||||||
|
from smugfolioapi.models.images import Images
|
||||||
|
from smugfolioapi.models.smug_users import Smug_Users
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
class Image_Tag_Assignments(models.Model):
|
||||||
|
|
||||||
|
image_tag_id = models.ForeignKey("Image_Tags", on_delete=models.CASCADE)
|
||||||
|
image_id = models.ForeignKey("Images", on_delete=models.CASCADE)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
from django.db import models
|
||||||
|
class Image_Tags(models.Model):
|
||||||
|
|
||||||
|
image_tag_name = models.CharField(max_length=256)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
from django.db import models
|
||||||
|
class Images(models.Model):
|
||||||
|
|
||||||
|
file_name = models.CharField(max_length=1024)
|
||||||
|
file_path = models.CharField(max_length=1024)
|
||||||
|
album_id = models.IntegerField(default=0)
|
||||||
|
smug_user_id = models.ForeignKey("Smug_Users", on_delete=models.CASCADE)
|
||||||
|
upload_date = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
# I believe that auto_now_add is the correct syntax. If I'm understanding this correctly, it only creates a timestamp when the object is first created.
|
||||||
|
# https://www.geeksforgeeks.org/datetimefield-django-models/
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
from django.db import models
|
||||||
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
class Smug_Users(models.Model):
|
||||||
|
|
||||||
|
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||||
|
business_name = models.CharField(max_length=256)
|
||||||
|
business_owner = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user