chore(database): remove unused EbookNote backward compatibility functions
- Remove CreateEbookNote, UpdateEbookNote, DeleteEbookNote queries - These were marked as backward compatibility but never used - API uses CreateMediaNote, UpdateMediaNote, DeleteMediaNote instead - Remove misleading backward compatibility comments - Regenerate sqlc code
This commit is contained in:
@@ -455,47 +455,6 @@ func (q *Queries) CreateDeviceShelfMapping(ctx context.Context, arg CreateDevice
|
||||
return i, err
|
||||
}
|
||||
|
||||
const CreateEbookNote = `-- name: CreateEbookNote :one
|
||||
INSERT INTO media_notes (media_item_id, user_id, content, position)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING id, media_item_id, user_id, content, position, created_at, updated_at, percentage_location, character_start, character_end, epubcfi_location, chapter_reference, paragraph_reference, device_sync_data
|
||||
`
|
||||
|
||||
type CreateEbookNoteParams struct {
|
||||
MediaItemID pgtype.UUID `db:"media_item_id" json:"media_item_id"`
|
||||
UserID pgtype.UUID `db:"user_id" json:"user_id"`
|
||||
Content string `db:"content" json:"content"`
|
||||
Position pgtype.Text `db:"position" json:"position"`
|
||||
}
|
||||
|
||||
// Backward compatibility - Ebook Notes queries (using views)
|
||||
func (q *Queries) CreateEbookNote(ctx context.Context, arg CreateEbookNoteParams) (MediaNotes, error) {
|
||||
row := q.db.QueryRow(ctx, CreateEbookNote,
|
||||
arg.MediaItemID,
|
||||
arg.UserID,
|
||||
arg.Content,
|
||||
arg.Position,
|
||||
)
|
||||
var i MediaNotes
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.MediaItemID,
|
||||
&i.UserID,
|
||||
&i.Content,
|
||||
&i.Position,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.PercentageLocation,
|
||||
&i.CharacterStart,
|
||||
&i.CharacterEnd,
|
||||
&i.EpubcfiLocation,
|
||||
&i.ChapterReference,
|
||||
&i.ParagraphReference,
|
||||
&i.DeviceSyncData,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const CreateLibrary = `-- name: CreateLibrary :one
|
||||
INSERT INTO libraries (name, description, library_type_id, created_by_admin_id)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
@@ -1267,15 +1226,6 @@ func (q *Queries) DeleteDeviceShelfMapping(ctx context.Context, id pgtype.UUID)
|
||||
return err
|
||||
}
|
||||
|
||||
const DeleteEbookNote = `-- name: DeleteEbookNote :exec
|
||||
DELETE FROM media_notes WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) DeleteEbookNote(ctx context.Context, id pgtype.UUID) error {
|
||||
_, err := q.db.Exec(ctx, DeleteEbookNote, id)
|
||||
return err
|
||||
}
|
||||
|
||||
const DeleteKoboEntitlement = `-- name: DeleteKoboEntitlement :exec
|
||||
DELETE FROM kobo_entitlements WHERE device_id = $1 AND entitlement_id = $2
|
||||
`
|
||||
@@ -6747,43 +6697,6 @@ func (q *Queries) UpdateDeviceSyncTimestamp(ctx context.Context, id pgtype.UUID)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const UpdateEbookNote = `-- name: UpdateEbookNote :one
|
||||
UPDATE media_notes SET
|
||||
content = $2,
|
||||
position = $3,
|
||||
updated_at = NOW()
|
||||
WHERE id = $1
|
||||
RETURNING id, media_item_id, user_id, content, position, created_at, updated_at, percentage_location, character_start, character_end, epubcfi_location, chapter_reference, paragraph_reference, device_sync_data
|
||||
`
|
||||
|
||||
type UpdateEbookNoteParams struct {
|
||||
ID pgtype.UUID `db:"id" json:"id"`
|
||||
Content string `db:"content" json:"content"`
|
||||
Position pgtype.Text `db:"position" json:"position"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateEbookNote(ctx context.Context, arg UpdateEbookNoteParams) (MediaNotes, error) {
|
||||
row := q.db.QueryRow(ctx, UpdateEbookNote, arg.ID, arg.Content, arg.Position)
|
||||
var i MediaNotes
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.MediaItemID,
|
||||
&i.UserID,
|
||||
&i.Content,
|
||||
&i.Position,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
&i.PercentageLocation,
|
||||
&i.CharacterStart,
|
||||
&i.CharacterEnd,
|
||||
&i.EpubcfiLocation,
|
||||
&i.ChapterReference,
|
||||
&i.ParagraphReference,
|
||||
&i.DeviceSyncData,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const UpdateEmail = `-- name: UpdateEmail :exec
|
||||
UPDATE users SET email = $2, updated_at = NOW() WHERE id = $1
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user