Commit 0a9f0cb9 authored by Javi Ng's avatar Javi Ng

made migrations

parent e5e3835a
No preview for this file type
# Generated by Django 3.2 on 2023-02-20 05:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='album',
name='label',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='album',
name='song_count',
field=models.CharField(default=0, max_length=50),
),
migrations.AddField(
model_name='artist',
name='bio',
field=models.CharField(default='', max_length=700),
),
migrations.AddField(
model_name='artist',
name='birth_name',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='song',
name='lyrics',
field=models.CharField(default='', max_length=1000),
),
migrations.AddField(
model_name='song',
name='music_video',
field=models.BooleanField(default=False),
),
]
...@@ -4,8 +4,8 @@ from django.db import models ...@@ -4,8 +4,8 @@ from django.db import models
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length = 50) artist_name = models.CharField(max_length = 50)
monthly_listeners = models.IntegerField(default = 0) monthly_listeners = models.IntegerField(default = 0)
birth_name = models.CharField(max_length = 100) birth_name = models.CharField(max_length = 100, default = "")
bio = models.CharField(max_length = 700) bio = models.CharField(max_length = 700, default = "")
def __str__(self): def __str__(self):
return self.artist_name return self.artist_name
...@@ -14,8 +14,8 @@ class Album(models.Model): ...@@ -14,8 +14,8 @@ class Album(models.Model):
album_name = models.CharField(max_length = 100) album_name = models.CharField(max_length = 100)
artist = models.ForeignKey(Artist, on_delete = models.CASCADE) artist = models.ForeignKey(Artist, on_delete = models.CASCADE)
description = models.CharField(max_length = 500) description = models.CharField(max_length = 500)
label = models.CharField(max_length = 100) label = models.CharField(max_length = 100, default = "")
song_count = models.CharField(max_length = 50) song_count = models.CharField(max_length = 50, default = 0)
release_date = models.DateTimeField("Date Released") release_date = models.DateTimeField("Date Released")
def __str__(self): def __str__(self):
...@@ -25,7 +25,7 @@ class Song(models.Model): ...@@ -25,7 +25,7 @@ class Song(models.Model):
song_title = models.CharField(max_length = 100) song_title = models.CharField(max_length = 100)
artist = models.ForeignKey(Artist, on_delete = models.CASCADE) artist = models.ForeignKey(Artist, on_delete = models.CASCADE)
album = models.ForeignKey(Album, on_delete = models.CASCADE) album = models.ForeignKey(Album, on_delete = models.CASCADE)
lyrics = models.CharField(max_length = 1000) lyrics = models.CharField(max_length = 1000, default = "")
song_length = models.IntegerField(default = 0) song_length = models.IntegerField(default = 0)
music_video = models.BooleanField(default = False) music_video = models.BooleanField(default = False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment