from django.db import models
from django.utils import timezone


class Snapshot(models.Model):
    data = models.JSONField()
    project = models.ForeignKey('web.Project', on_delete=models.CASCADE)
    created_at = models.DateTimeField(default=timezone.now)

    class Meta:
        indexes = [
            models.Index(fields=['project', '-created_at'])
        ]
