Databse design one table for several tables - django models
I'm working on a project has two models one for Invoice and the other for payments, in the both tables should have a field named next pay
for the loaners to determine when he/she should pay his/her loan
class Payment(models.Model):
admin = models.ForeignKey(User,on_delete=models.CASCADE)
price = models.DecimalField(max_digits=20,decimal_places=3)
#others
class CustomerInvoice(models.Model):
seller = models.ForeignKey(User,on_delete=models.PROTECT)
customer = models.CharField(max_length=50)
#others
should i add new fields named next pay
for both two models or create a new model , something like this
class NextPayment(models.Model):
next_pay = models.DateTimeField()
and add NextPayment as ForeignKey for two both models ? which one is the most effective way please ? thank you in advance ..