Adapts feed model for database to new table schema

This commit is contained in:
Dennis Schoepf 2024-09-03 20:29:03 +02:00
parent a9618f950e
commit 6151e9ed80

View file

@ -2,18 +2,13 @@ package database
type FeedType string type FeedType string
const (
RSS FeedType = "RSS"
)
type Feed struct { type Feed struct {
Name string Name string
Url string Url string
FeedType FeedType
} }
func (f Feed) Insert() (int64, error) { func (f Feed) Insert() (int64, error) {
result, err := db.Exec("INSERT INTO feed (name, url, type) VALUES (?,?,?)", f.Name, f.Url, f.FeedType) result, err := db.Exec("INSERT INTO feed (name, url) VALUES (?,?)", f.Name, f.Url)
if err != nil { if err != nil {
return 0, err return 0, err