2021-11-21 14:05:07 +01:00
package migrate
2022-04-25 09:53:55 +02:00
// Generated code, do not edit.
2021-12-09 07:37:49 +01:00
var DialectSQLite3 = Migrations {
2021-11-21 14:05:07 +01:00
{
2021-11-24 12:42:18 +01:00
ID : "20211121-094727" ,
2021-12-09 07:37:49 +01:00
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2021-11-24 12:42:18 +01:00
Statements : [ ] string { "DROP INDEX IF EXISTS idx_places_place_label;" } ,
} ,
{
ID : "20211124-120008" ,
2021-12-09 07:37:49 +01:00
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
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;" } ,
2021-11-21 14:05:07 +01:00
} ,
2022-03-30 20:36:25 +02:00
{
ID : "20220329-040000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-03-30 20:36:25 +02:00
Statements : [ ] string { "DROP INDEX IF EXISTS idx_albums_album_filter;" } ,
} ,
{
ID : "20220329-050000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-01 16:49:26 +02:00
Statements : [ ] string { "CREATE INDEX IF NOT EXISTS idx_albums_album_filter ON albums (album_filter);" } ,
2022-03-30 20:36:25 +02:00
} ,
{
ID : "20220329-061000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-01 16:49:26 +02:00
Statements : [ ] string { "CREATE INDEX IF NOT EXISTS idx_files_photo_id ON files (photo_id, file_primary);" } ,
2022-03-30 20:36:25 +02:00
} ,
{
ID : "20220329-071000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-02 18:33:57 +02:00
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;" } ,
2022-03-30 20:36:25 +02:00
} ,
{
ID : "20220329-081000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-03-30 20:36:25 +02:00
Statements : [ ] string { "CREATE UNIQUE INDEX IF NOT EXISTS idx_files_search_media ON files (media_id);" } ,
} ,
{
2022-04-21 22:44:59 +02:00
ID : "20220329-083000" ,
2022-03-30 20:36:25 +02:00
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-21 21:56:53 +02:00
Statements : [ ] string { "UPDATE files SET media_id = CASE WHEN photo_id IS NOT NULL AND file_missing = 0 AND deleted_at IS NULL THEN ((10000000000 - photo_id) || '-' || (1 + file_sidecar - file_primary) || '-' || file_uid) END WHERE 1;" } ,
2022-03-30 20:36:25 +02:00
} ,
{
ID : "20220329-091000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-03-30 20:36:25 +02:00
Statements : [ ] string { "CREATE UNIQUE INDEX IF NOT EXISTS idx_files_search_timeline ON files (time_index);" } ,
} ,
{
2022-04-21 22:44:59 +02:00
ID : "20220329-093000" ,
2022-03-30 20:36:25 +02:00
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-21 21:56:53 +02:00
Statements : [ ] string { "UPDATE files SET time_index = CASE WHEN media_id IS NOT NULL AND photo_taken_at IS NOT NULL THEN ((100000000000000 - strftime('%Y%m%d%H%M%S', photo_taken_at)) || '-' || media_id) ELSE NULL END WHERE photo_id IS NOT NULL;" } ,
} ,
{
ID : "20220421-200000" ,
Dialect : "sqlite3" ,
2022-10-15 21:54:11 +02:00
Stage : "main" ,
2022-04-21 21:56:53 +02:00
Statements : [ ] string { "CREATE INDEX IF NOT EXISTS idx_files_missing_root ON files (file_missing, file_root);" } ,
2022-03-30 20:36:25 +02:00
} ,
2022-10-15 21:54:11 +02:00
{
ID : "20221015-100000" ,
Dialect : "sqlite3" ,
Stage : "pre" ,
Statements : [ ] string { "ALTER TABLE accounts RENAME TO services;" } ,
} ,
{
ID : "20221015-100100" ,
Dialect : "sqlite3" ,
Stage : "pre" ,
Statements : [ ] string { "ALTER TABLE files_sync RENAME COLUMN account_id TO service_id;" , "ALTER TABLE files_share RENAME COLUMN account_id TO service_id;" } ,
} ,
2021-11-21 14:05:07 +01:00
}