zerobyte/app/drizzle/20251226160333_migrate-local-repo-paths/migration.sql
Nico 35773a6969
refactor: upgrade to drizzle v1 (#450)
* refactor: move migrations to new structure

* refactor: convert all findMany to new structure

* fix(backups-schedule): missing null matching for last backup status

* chore: move root lib to server
2026-02-01 19:14:52 +01:00

10 lines
566 B
SQL

-- Migrate local imported repository paths to include the repository name
-- Previously, the path and name were concatenated at runtime. Now the path should be the full path.
UPDATE `repositories_table`
SET `config` = json_set(`config`, '$.path', rtrim(json_extract(`config`, '$.path'), '/') || '/' || json_extract(`config`, '$.name')),
`updated_at` = (unixepoch() * 1000)
WHERE `type` = 'local'
AND json_extract(`config`, '$.isExistingRepository') = true
AND json_extract(`config`, '$.path') IS NOT NULL
AND json_extract(`config`, '$.name') IS NOT NULL;