Files
bookhoard/database/schema/normalize_folder_paths.sql
T
john-okeefe 08e80ae84b refactor: reorganize project structure and update configurations
- Move migrations/ to database/schema/ for clarity on database schema definitions
- Move sqlc.yaml to internal/database/ to group with database code
- Move static/ to cmd/server/static/ to co-locate with server
- Update all configuration files and documentation
- Follow Go project conventions for better organization
2026-01-24 23:40:31 -05:00

15 lines
579 B
SQL

-- Normalize existing folder paths in user_ebook_folders table
-- This script will clean up inconsistent path formatting
UPDATE user_ebook_folders
SET folder_path = REPLACE(REPLACE(folder_path, '\\', '/'), '//', '/')
WHERE folder_path LIKE '%\\%' OR folder_path LIKE '%//%';
-- Remove trailing slashes from non-root paths
UPDATE user_ebook_folders
SET folder_path = CASE
WHEN folder_path = '/' THEN '/'
WHEN RIGHT(folder_path, 1) = '/' THEN LEFT(folder_path, LENGTH(folder_path) - 1)
ELSE folder_path
END
WHERE folder_path != '/' AND RIGHT(folder_path, 1) = '/';