Commit 089eec81 authored by Nicholo Pardines's avatar Nicholo Pardines

Added cascade to the foreign key parameters

parent 20465f43
...@@ -22,12 +22,12 @@ class Artist(models.Model): ...@@ -22,12 +22,12 @@ class Artist(models.Model):
class Album(models.Model): class Album(models.Model):
album_name = models.CharField() album_name = models.CharField()
artist = models.ForeignKey(Artist) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
description = models.CharField() description = models.CharField()
release_date = models.IntegerField() release_date = models.IntegerField()
class Song(models.Model): class Song(models.Model):
song_title = models.CharField() song_title = models.CharField()
artist = models.ForeignKey(Artist) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
album = models.ForeignKey(Album) album = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField() song_length = models.IntegerField()
\ No newline at end of file
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