Skip to content

Commit

Permalink
Commit message:
Browse files Browse the repository at this point in the history
Add initial Django migrations for music app

This commit introduces the initial Django migrations for the music application. It creates the models for Artist, Album, and Song, with the necessary fields and dependencies. This lays the foundation for the music database schema and facilitates further data operations.
  • Loading branch information
lipemorais committed Apr 21, 2024
1 parent 3ecd5d2 commit 0839b9c
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions first_api/music/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Generated by Django 5.0.3 on 2024-04-21 21:58

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="Artist",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name="Album",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=100)),
("release_year", models.IntegerField()),
(
"artist",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="music.artist"
),
),
],
),
migrations.CreateModel(
name="Song",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("author", models.CharField(max_length=100)),
("title", models.CharField(max_length=100)),
("duration", models.IntegerField()),
(
"album",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="music.album"
),
),
(
"artist",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="music.artist"
),
),
],
),
]

0 comments on commit 0839b9c

Please sign in to comment.