webcompat / webcompat-metrics-server

Server in charge of delivering different data to the webcompat-metrics-client
Mozilla Public License 2.0
6 stars 5 forks source link

Create a table for collecting daily new issue counts #82

Closed laghee closed 5 years ago

laghee commented 5 years ago

Potential "daily total" model:

class DailyTotal(db.Model):
    """Define a DailyTotal for new issues filed.

    An daily total has:

    * a unique table id
    * a day representing the date that corresponds to the total
    * a count of the issues filed on this date
    """
    id = db.Column(db.Integer, primary_key=True)
    day = db.Column(db.DateTime, nullable=False)
    count = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        """Representation of DailyTotal."""
        return '<DailyTotal for {day}: {count}'.format(
            day=self.day,
            count=self.count
        )