mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-10 07:50:37 -07:00
fix: set first artist listed as primary by default (#81)
This commit is contained in:
parent
cd31b6f2d8
commit
70f5198781
17 changed files with 46 additions and 26 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.29.0
|
||||
// sqlc v1.30.0
|
||||
// source: track.sql
|
||||
|
||||
package repository
|
||||
|
|
@ -13,18 +13,19 @@ import (
|
|||
)
|
||||
|
||||
const associateArtistToTrack = `-- name: AssociateArtistToTrack :exec
|
||||
INSERT INTO artist_tracks (artist_id, track_id)
|
||||
VALUES ($1, $2)
|
||||
INSERT INTO artist_tracks (artist_id, track_id, is_primary)
|
||||
VALUES ($1, $2, $3)
|
||||
ON CONFLICT DO NOTHING
|
||||
`
|
||||
|
||||
type AssociateArtistToTrackParams struct {
|
||||
ArtistID int32
|
||||
TrackID int32
|
||||
ArtistID int32
|
||||
TrackID int32
|
||||
IsPrimary bool
|
||||
}
|
||||
|
||||
func (q *Queries) AssociateArtistToTrack(ctx context.Context, arg AssociateArtistToTrackParams) error {
|
||||
_, err := q.db.Exec(ctx, associateArtistToTrack, arg.ArtistID, arg.TrackID)
|
||||
_, err := q.db.Exec(ctx, associateArtistToTrack, arg.ArtistID, arg.TrackID, arg.IsPrimary)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue