Adds feed type to Feed struct and table schema

This commit is contained in:
Dennis Schoepf 2024-05-31 19:55:39 +02:00
parent efff6edf0e
commit 4f86ab9cb0
2 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1,7 @@
-- +migrate Up
ALTER TABLE feed
ADD COLUMN type text;
-- +migrate Down
ALTER TABLE feed
DROP COLUMN type;

View file

@ -1,8 +1,16 @@
package model
type FeedType int
const (
Rss FeedType = iota
Youtube
)
type Feed struct {
ID int64 `json:"id"`
Name string `json:"name"`
Url string `json:"url" validate:"required,url"`
UserID string `json:"userId" validate:"required"`
ID int64 `json:"id"`
Name string `json:"name"`
Url string `json:"url" validate:"required,url"`
UserID string `json:"userId" validate:"required"`
Type FeedType `json:"type"`
}