app_event_webhook.go 968 B

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "database/sql"
  4. "github.com/google/uuid"
  5. "github.com/jmoiron/sqlx/types"
  6. "gorm.io/gorm"
  7. )
  8. // AppEventWebhooks is a gorm model for storing webhook configuration for an app
  9. type AppEventWebhooks struct {
  10. gorm.Model
  11. // ID is a unqiue identifier of an AppEventWebhook entry
  12. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  13. CreatedAt sql.NullTime `db:"created_at"`
  14. UpdatedAt sql.NullTime `db:"updated_at"`
  15. DeletedAt sql.NullTime `db:"deleted_at"`
  16. // ProjectID uniquely identifies the project this app is in
  17. ProjectID uint `db:"project_id"`
  18. // AppInstanceID uniquely identifies the application this webhook URL is configured for
  19. AppInstanceID uuid.UUID `db:"app_instance_id"`
  20. // webhooksJSON is a json text holding webhook configuration for an app
  21. WebhooksJSON types.JSONText `db:"webhooks_json"`
  22. }
  23. // TableName overrides the table name
  24. func (AppEventWebhooks) TableName() string {
  25. return "app_event_webhooks"
  26. }