Skip to content

Commit

Permalink
feat:make migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 committed Dec 10, 2023
1 parent aba3159 commit e2e6661
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.7 on 2023-12-10 09:21

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("news", "0002_ticker_news_sentiment"),
]

operations = [
migrations.AlterField(
model_name="ticker",
name="ticker",
field=models.CharField(max_length=100, unique=True),
),
migrations.AlterUniqueTogether(
name="news",
unique_together={("symbol", "headline")},
),
]
5 changes: 4 additions & 1 deletion applications/backend/django_server/news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ class News(models.Model):

sentiment = models.CharField(max_length=100)

class Meta:
unique_together = ("symbol", "headline")

def __str__(self):
return self.headline


class Ticker(models.Model):
ticker = models.CharField(max_length=100)
ticker = models.CharField(max_length=100, unique=True)

def __str__(self):
return self.ticker

0 comments on commit e2e6661

Please sign in to comment.