Bootcamp/Web

[Django] Django

K_Hyul 2024. 1. 11. 10:45
728x90

migrations ?

 

models.py에 

class Question(models.Model): # class가 table
    subject = models.CharField(max_length=200) # column , type
    content = models.TextField()
    create_date = models.DateTimeField()




class Answer(models.Model):
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    content = models.TextField()
    create_date = models.DateTimeField()

추가를 해줬다.

 

터미널에서 

python manage.py makemigrations
python manage.py migrate

 

728x90

'Bootcamp > Web' 카테고리의 다른 글

[Django] 첫 설치  (0) 2024.01.10
[Crawling] 주식 정보  (1) 2024.01.04
[Notalone] mini project (web)  (0) 2023.12.27
[Spring] Spring Security  (0) 2023.12.27
[Spring] Spring _ Validation, Valid annotation & Exception  (0) 2023.12.07