from django.db import models

from domini.models import *
from causali.models import *

# Create your models here.
class History(models.Model):
  id             = models.IntegerField(db_column='id',primary_key=True)
  data           = models.DateField(db_column='data')
  domain         = models.ForeignKey('domini.Domini',db_column='domain',on_delete=models.CASCADE)
  causale        = models.ForeignKey('causali.Causale',db_column='causale',on_delete=models.PROTECT)
  vecchio_record = models.TextField(db_column='vecchio_record')
  nuovo_record   = models.TextField(db_column='nuovo_record')
  nota           = models.TextField(db_column='nota')
  uuid           = models.CharField(db_column='uuid',max_length=36)
  used           = models.BooleanField(db_column='used')
  answer         = models.TextField(db_column='answer')
  class Meta:
    ordering = ['id']
    db_table = 'domain_history'
    managed = False

