from django.db import models
from jsonfield import JSONField


class Repository(models.Model):
    # github, gitbucket, etc...
    hub = models.CharField(max_length=191, db_index=True)
    # user
    user = models.CharField(max_length=191)
    # repository_name
    name = models.CharField(max_length=191)
    # username/reponame
    full_name = models.CharField(max_length=191, db_index=True)
    # Secret Key
    secret = models.CharField(max_length=191, db_index=True)


class DeploySetting(models.Model):
    repository = models.ForeignKey(Repository)
    branch = models.CharField(max_length=191)
    command = models.TextField()


class HookLog(models.Model):
    body = JSONField()


class DeployLog(models.Model):
    log = models.TextField()

@@ -667,12 +667,12 @@
     
-body
+data
  = J
@@ -674,32 +674,101 @@
 a = JSONField()%0A
+    created_at = models.DateTimeField(%22%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89%E4%BD%9C%E6%88%90%E6%97%A5%E6%99%82%22, auto_now_add=True)%0A
 %0A%0Aclass DeployLo

update hook log