stash/pkg/sqlite/migrations
WithoutPants d8448ba37e
Add basename and parent_folders fields to Folder graphql interface (#6494)
* Add basename field to folder
* Add parent_folders field to folder
* Add basename column to folder table
* Add basename filter field
* Create missing folder hierarchies during migration
* Treat files/folders in zips where path can't be made relative as not found

Addresses an issue during clean where corrupt folder entries in zip files could not be removed due to an error during the call to Rel.
2026-02-27 10:58:11 +11:00
..
1_initial.down.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
1_initial.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
2_cover_image.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
3_o_counter.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
4_movie.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
5_performer_gender.down.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
5_performer_gender.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
6_scenes_format.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
7_performer_optimization.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
8_movie_fix.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
9_studios_parent_studio.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
10_image_tables.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
11_tag_image.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
12_oshash.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
12_postmigrate.go Only set video algorithm after migration 12 (#2946) 2022-09-26 11:27:53 +10:00
13_images.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
14_stash_box_ids.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
15_file_mod_time.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
16_organized_flag.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
17_reset_scene_size.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
18_scene_galleries.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
19_performer_tags.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
20_phash.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
21_performers_studios_details.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
22_performers_studios_rating.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
23_scenes_interactive.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
24_tag_aliases.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
25_saved_filters.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
26_tag_hierarchy.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
27_studio_aliases.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
28_images_indexes.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
29_interactive_speed.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
30_ignore_autotag.up..sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
31_scenes_captions.up.sql Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
32_files.up.sql Handle null video durations in migration (#3021) 2022-10-20 10:58:42 +11:00
32_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
32_premigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
33_noop.up.sql More timestamp corrections (#2933) 2022-09-20 13:52:37 +10:00
34_indexes.up.sql More timestamp corrections (#2933) 2022-09-20 13:52:37 +10:00
34_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
35_assoc_tables.up.sql Ignore NULL values during migration 2022-10-20 01:01:18 +00:00
36_tags_description.up.sql Add descriptions to tags and display tag cards on hover (#2708) 2022-10-06 10:01:06 +11:00
37_iso_country_names.up.sql Change performer country value to be ISO code (#1922) 2022-10-28 16:37:57 +11:00
38_scenes_director_code.up.sql [Feature] Add fields director and (studio) code to scenes (#3051) 2022-11-07 18:16:52 +11:00
39_performer_height.up.sql Change performer height to be numeric (#3060) 2022-11-08 14:09:03 +11:00
40_newratings.up.sql Stash rating system (#2830) 2022-11-16 09:31:44 +11:00
41_scene_activity.up.sql Track watch activity for scenes. (#3055) 2022-11-21 12:55:15 +11:00
42_performer_disambig_aliases.up.sql Fix performer migration (#3285) 2022-12-19 11:24:42 +11:00
42_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
43_image_date_url.up.sql [Feature] Images new fields : URL & Date (#3015) 2022-12-20 11:13:41 +11:00
44_gallery_chapters.up.sql Add Chapters for Galleries (#3289) 2023-03-16 15:04:54 +11:00
45_blobs.up.sql Add filesystem based blob storage (#3187) 2023-03-17 10:52:49 +11:00
45_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
46_penis_stats.up.sql Add penis length and circumcision stats to performers. (#3627) 2023-05-24 13:19:35 +10:00
47_scene_urls.up.sql Multiple scene URLs (#3852) 2023-07-12 11:51:52 +10:00
48_cleanup.up.sql SQLite model refactoring, part 2 (#3839) 2023-07-13 12:15:02 +10:00
48_premigrate.go Database connection pool refactor (#5274) 2024-09-20 12:56:26 +10:00
49_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
49_saved_filter_refactor.up.sql Saved filter refactor (#4054) 2023-09-01 10:04:56 +10:00
50_image_urls.up.sql Multiple image URLs (#4000) 2023-09-12 13:31:53 +10:00
51_gallery_urls.up.sql Gallery URLs (#4114) 2023-09-25 12:27:20 +10:00
52_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
52_zip_folder_data_correct.up.sql Fix data corruption when moving folders (#4169) 2023-10-03 17:05:08 +11:00
53_gallery_photographer_code.up.sql Add Studio Code and Photographer to Galleries. (#4195) 2023-11-28 15:05:33 +11:00
54_image_code_details_photographer.up.sql Add Details, Studio Code, and Photographer to Images (#4217) 2023-11-28 15:45:07 +11:00
55_manual_history.up.sql Scene play and o-counter history view and editing (#4532) 2024-02-22 11:28:18 +11:00
55_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
56_studio_favorite.up.sql Add support for favorite Studios (#4675) 2024-03-14 11:17:44 +11:00
57_tag_favorite.up.sql Tag Favoriting (#4728) 2024-05-09 12:04:58 +10:00
58_config_correct.up.sql Replace viper with koanf (#4845) 2024-05-21 11:24:47 +10:00
58_postmigrate.go Rename movies to groups in menu items in 65 post-migration (#5247) 2024-09-11 13:39:46 +10:00
59_movie_urls.up.sql Movie URLs (#4900) 2024-06-11 13:08:49 +10:00
60_default_filter_move.up.sql Default view filters (#4962) 2024-06-18 10:51:52 +10:00
60_postmigrate.go Database connection pool refactor (#5274) 2024-09-20 12:56:26 +10:00
61_movie_tags.up.sql Movie/Group tags (#4969) 2024-06-18 11:24:15 +10:00
62_performer_urls.up.sql adding exists check before dropping constraints (#5363) 2024-10-15 13:10:47 +11:00
63_studio_tags.up.sql Add tags to studios (#4858) 2024-06-18 15:55:20 +10:00
64_fixes.up.sql Add schema migration to fix view_date format (#4992) 2024-06-24 13:15:54 +10:00
64_postmigrate.go Fix migrations not using tx (#5282) 2024-09-22 14:03:54 +10:00
65_movie_group_rename.up.sql Rename movie tables to groups in database schema (#5082) 2024-07-30 14:14:16 +10:00
65_postmigrate.go Rename movies to groups in menu items in 65 post-migration (#5247) 2024-09-11 13:39:46 +10:00
66_gallery_cover.up.sql Support for assigning any image from a gallery as the cover (#5053) 2024-08-29 11:24:52 +10:00
67_group_relationships.up.sql Containing Group/Sub-Group relationships (#5105) 2024-08-30 11:43:44 +10:00
68_image_studio_index.up.sql Exclude null values from image studio id index (#5335) 2024-10-03 11:53:29 +10:00
69_stash_id_updated_at.up.sql Add updated_at field to stash_id's (#5259) 2024-10-31 15:56:16 +11:00
70_markers_end.up.sql Markers can have end time (#5311) 2024-11-02 11:55:48 +11:00
71_custom_fields.up.sql Performer custom fields (#5487) 2024-12-03 13:49:55 +11:00
72_tag_sort_name.up.sql Add Sort Name to Tags (#5531) 2025-02-11 08:17:21 +11:00
73_studio_urls.up.sql Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00
74_tag_stash_ids.up.sql Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
75_date_precision.up.sql Date precision (#6359) 2025-12-08 09:11:40 +11:00
76_studio_custom_fields.up.sql Studio custom fields backend support (#6156) 2026-02-05 09:01:29 +11:00
77_tag_custom_fields.up.sql Tag custom fields support for backend (#6546) 2026-02-06 12:35:05 +11:00
78_performer_career_dates.up.sql FR: Change Career Length to Career Start and Career End (#6449) 2026-02-17 13:44:03 +11:00
78_postmigrate.go FR: Change Career Length to Career Start and Career End (#6449) 2026-02-17 13:44:03 +11:00
79_scene_custom_fields.up.sql Scene custom field backend support (#6584) 2026-02-18 16:50:32 +11:00
80_studio_organized.up.sql Feature Request: Add organized flag to studios (#6303) 2026-02-19 09:05:17 +11:00
81_gallery_custom_fields.up.sql Backend support for gallery custom fields (#6592) 2026-02-23 07:39:28 +11:00
82_group_custom_fields.up.sql Backend support for Group custom fields (#6596) 2026-02-23 11:53:12 +11:00
83_image_custom_fields.up.sql Backend support for image custom fields (#6598) 2026-02-24 07:41:40 +11:00
84_folder_basename.up.sql Add basename and parent_folders fields to Folder graphql interface (#6494) 2026-02-27 10:58:11 +11:00
84_postmigrate.go Add basename and parent_folders fields to Folder graphql interface (#6494) 2026-02-27 10:58:11 +11:00
custom_migration.go Performer disambiguation and aliases (#3113) 2022-12-01 13:54:08 +11:00
README.md Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00

Creating a migration

  1. Create new migration file in the migrations directory with the format NN_description.up.sql, where NN is the next sequential number.

  2. Update pkg/sqlite/database.go to update the appSchemaVersion value to the new migration number.

For migrations requiring complex logic or config file changes, see existing custom migrations for examples.