Adapts feed model for database to new table schema
This commit is contained in:
parent
a9618f950e
commit
6151e9ed80
1 changed files with 3 additions and 8 deletions
|
|
@ -2,18 +2,13 @@ package database
|
|||
|
||||
type FeedType string
|
||||
|
||||
const (
|
||||
RSS FeedType = "RSS"
|
||||
)
|
||||
|
||||
type Feed struct {
|
||||
Name string
|
||||
Url string
|
||||
FeedType FeedType
|
||||
Name string
|
||||
Url string
|
||||
}
|
||||
|
||||
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 {
|
||||
return 0, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue