photoprism/internal/migrate/dialect_sqlite3.go

56 lines
2.1 KiB
Go
Raw Normal View History

// Code generated by go generate; DO NOT EDIT.
package migrate
var DialectSQLite3 = Migrations{
{
2021-11-24 12:42:18 +01:00
ID: "20211121-094727",
Dialect: "sqlite3",
2021-11-24 12:42:18 +01:00
Statements: []string{"DROP INDEX IF EXISTS idx_places_place_label;"},
},
{
ID: "20211124-120008",
Dialect: "sqlite3",
2021-11-24 12:42:18 +01:00
Statements: []string{"DROP INDEX IF EXISTS uix_places_place_label;", "DROP INDEX IF EXISTS uix_places_label;"},
},
{
ID: "20220329-040000",
Dialect: "sqlite3",
Statements: []string{"DROP INDEX IF EXISTS idx_albums_album_filter;"},
},
{
ID: "20220329-050000",
Dialect: "sqlite3",
Statements: []string{"CREATE INDEX IF NOT EXISTS idx_albums_album_filter ON albums (album_filter);"},
},
{
ID: "20220329-061000",
Dialect: "sqlite3",
Statements: []string{"CREATE INDEX IF NOT EXISTS idx_files_photo_id ON files (photo_id, file_primary);"},
},
{
ID: "20220329-071000",
Dialect: "sqlite3",
Statements: []string{"UPDATE files SET photo_taken_at = (SELECT taken_at_local FROM photos WHERE photos.id = photo_id) WHERE photo_id IS NOT NULL;"},
},
{
ID: "20220329-081000",
Dialect: "sqlite3",
Statements: []string{"CREATE UNIQUE INDEX IF NOT EXISTS idx_files_search_media ON files (media_id);"},
},
{
ID: "20220329-082000",
Dialect: "sqlite3",
Statements: []string{"UPDATE files SET media_id = CASE WHEN file_uid <> '' AND photo_id > 0 AND file_missing = 0 AND deleted_at IS NULL THEN (HEX(100000000000 - photo_id) || '-' || (1 + file_sidecar - file_primary) || '-' || file_uid) ELSE NULL END WHERE photo_id IS NOT NULL;"},
},
{
ID: "20220329-091000",
Dialect: "sqlite3",
Statements: []string{"CREATE UNIQUE INDEX IF NOT EXISTS idx_files_search_timeline ON files (time_index);"},
},
{
ID: "20220329-092000",
Dialect: "sqlite3",
Statements: []string{"UPDATE files SET time_index = CASE WHEN media_id IS NOT NULL AND photo_taken_at IS NOT NULL THEN ((100000000000000 - CAST(photo_taken_at AS UNSIGNED)) || '-' || media_id) ELSE NULL END WHERE photo_id IS NOT NULL;"},
},
}