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:
@@ -49,8 +49,6 @@ type Querier interface {
|
|||||||
// DEVICE SHELF MAPPINGS QUERIES
|
// DEVICE SHELF MAPPINGS QUERIES
|
||||||
// Create device shelf mapping
|
// Create device shelf mapping
|
||||||
CreateDeviceShelfMapping(ctx context.Context, arg CreateDeviceShelfMappingParams) (DeviceShelfMappings, error)
|
CreateDeviceShelfMapping(ctx context.Context, arg CreateDeviceShelfMappingParams) (DeviceShelfMappings, error)
|
||||||
// Backward compatibility - Ebook Notes queries (using views)
|
|
||||||
CreateEbookNote(ctx context.Context, arg CreateEbookNoteParams) (MediaNotes, error)
|
|
||||||
// Libraries queries
|
// Libraries queries
|
||||||
CreateLibrary(ctx context.Context, arg CreateLibraryParams) (Libraries, error)
|
CreateLibrary(ctx context.Context, arg CreateLibraryParams) (Libraries, error)
|
||||||
// Media Highlights queries
|
// Media Highlights queries
|
||||||
@@ -95,7 +93,6 @@ type Querier interface {
|
|||||||
DeleteDeviceFileAlias(ctx context.Context, id pgtype.UUID) error
|
DeleteDeviceFileAlias(ctx context.Context, id pgtype.UUID) error
|
||||||
// Delete device shelf mapping
|
// Delete device shelf mapping
|
||||||
DeleteDeviceShelfMapping(ctx context.Context, id pgtype.UUID) error
|
DeleteDeviceShelfMapping(ctx context.Context, id pgtype.UUID) error
|
||||||
DeleteEbookNote(ctx context.Context, id pgtype.UUID) error
|
|
||||||
DeleteKoboEntitlement(ctx context.Context, arg DeleteKoboEntitlementParams) error
|
DeleteKoboEntitlement(ctx context.Context, arg DeleteKoboEntitlementParams) error
|
||||||
DeleteLibrary(ctx context.Context, id pgtype.UUID) error
|
DeleteLibrary(ctx context.Context, id pgtype.UUID) error
|
||||||
DeleteLibraryFolder(ctx context.Context, arg DeleteLibraryFolderParams) (LibraryFolders, error)
|
DeleteLibraryFolder(ctx context.Context, arg DeleteLibraryFolderParams) (LibraryFolders, error)
|
||||||
@@ -283,7 +280,6 @@ type Querier interface {
|
|||||||
// Update device shelf mapping
|
// Update device shelf mapping
|
||||||
UpdateDeviceShelfMapping(ctx context.Context, arg UpdateDeviceShelfMappingParams) (DeviceShelfMappings, error)
|
UpdateDeviceShelfMapping(ctx context.Context, arg UpdateDeviceShelfMappingParams) (DeviceShelfMappings, error)
|
||||||
UpdateDeviceSyncTimestamp(ctx context.Context, id pgtype.UUID) (Devices, error)
|
UpdateDeviceSyncTimestamp(ctx context.Context, id pgtype.UUID) (Devices, error)
|
||||||
UpdateEbookNote(ctx context.Context, arg UpdateEbookNoteParams) (MediaNotes, error)
|
|
||||||
UpdateEmail(ctx context.Context, arg UpdateEmailParams) error
|
UpdateEmail(ctx context.Context, arg UpdateEmailParams) error
|
||||||
UpdateKoboEntitlementRevision(ctx context.Context, arg UpdateKoboEntitlementRevisionParams) error
|
UpdateKoboEntitlementRevision(ctx context.Context, arg UpdateKoboEntitlementRevisionParams) error
|
||||||
UpdateKoboEntitlementStatus(ctx context.Context, arg UpdateKoboEntitlementStatusParams) error
|
UpdateKoboEntitlementStatus(ctx context.Context, arg UpdateKoboEntitlementStatusParams) error
|
||||||
|
|||||||
@@ -455,47 +455,6 @@ func (q *Queries) CreateDeviceShelfMapping(ctx context.Context, arg CreateDevice
|
|||||||
return i, err
|
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
|
const CreateLibrary = `-- name: CreateLibrary :one
|
||||||
INSERT INTO libraries (name, description, library_type_id, created_by_admin_id)
|
INSERT INTO libraries (name, description, library_type_id, created_by_admin_id)
|
||||||
VALUES ($1, $2, $3, $4)
|
VALUES ($1, $2, $3, $4)
|
||||||
@@ -1267,15 +1226,6 @@ func (q *Queries) DeleteDeviceShelfMapping(ctx context.Context, id pgtype.UUID)
|
|||||||
return err
|
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
|
const DeleteKoboEntitlement = `-- name: DeleteKoboEntitlement :exec
|
||||||
DELETE FROM kobo_entitlements WHERE device_id = $1 AND entitlement_id = $2
|
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
|
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
|
const UpdateEmail = `-- name: UpdateEmail :exec
|
||||||
UPDATE users SET email = $2, updated_at = NOW() WHERE id = $1
|
UPDATE users SET email = $2, updated_at = NOW() WHERE id = $1
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -470,23 +470,6 @@ RETURNING *;
|
|||||||
-- name: DeleteMediaHighlight :exec
|
-- name: DeleteMediaHighlight :exec
|
||||||
DELETE FROM media_highlights WHERE id = $1;
|
DELETE FROM media_highlights WHERE id = $1;
|
||||||
|
|
||||||
-- Backward compatibility - Ebook Notes queries (using views)
|
|
||||||
-- name: CreateEbookNote :one
|
|
||||||
INSERT INTO media_notes (media_item_id, user_id, content, position)
|
|
||||||
VALUES ($1, $2, $3, $4)
|
|
||||||
RETURNING *;
|
|
||||||
|
|
||||||
-- name: UpdateEbookNote :one
|
|
||||||
UPDATE media_notes SET
|
|
||||||
content = $2,
|
|
||||||
position = $3,
|
|
||||||
updated_at = NOW()
|
|
||||||
WHERE id = $1
|
|
||||||
RETURNING *;
|
|
||||||
|
|
||||||
-- name: DeleteEbookNote :exec
|
|
||||||
DELETE FROM media_notes WHERE id = $1;
|
|
||||||
|
|
||||||
-- Refresh Tokens queries
|
-- Refresh Tokens queries
|
||||||
-- name: CreateRefreshToken :one
|
-- name: CreateRefreshToken :one
|
||||||
INSERT INTO refresh_tokens (user_id, token, expires_at)
|
INSERT INTO refresh_tokens (user_id, token, expires_at)
|
||||||
|
|||||||
Reference in New Issue
Block a user