From ba1e0c904f810193f25d4f88cc2bb168f1d625fe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 27 Oct 2025 03:00:27 +0900 Subject: feat(backend): Make feeds.user_id column non-null --- backend/db/feeds.sql.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'backend/db/feeds.sql.go') diff --git a/backend/db/feeds.sql.go b/backend/db/feeds.sql.go index 9d6c5c1..140fa3a 100644 --- a/backend/db/feeds.sql.go +++ b/backend/db/feeds.sql.go @@ -7,12 +7,11 @@ package db import ( "context" - "database/sql" ) const createFeed = `-- name: CreateFeed :one -INSERT INTO feeds (url, title, fetched_at) -VALUES (?, ?, ?) +INSERT INTO feeds (url, title, fetched_at, user_id) +VALUES (?, ?, ?, ?) RETURNING id, url, title, fetched_at, is_subscribed, user_id ` @@ -20,10 +19,16 @@ type CreateFeedParams struct { Url string Title string FetchedAt string + UserID int64 } func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (Feed, error) { - row := q.db.QueryRowContext(ctx, createFeed, arg.Url, arg.Title, arg.FetchedAt) + row := q.db.QueryRowContext(ctx, createFeed, + arg.Url, + arg.Title, + arg.FetchedAt, + arg.UserID, + ) var i Feed err := row.Scan( &i.ID, @@ -133,7 +138,7 @@ type GetFeedsToFetchRow struct { ID int64 Url string FetchedAt string - UserID sql.NullInt64 + UserID int64 } func (q *Queries) GetFeedsToFetch(ctx context.Context) ([]GetFeedsToFetchRow, error) { -- cgit v1.2.3-70-g09d2