stash/pkg/sqlite/migrations/73_studio_urls.up.sql
Gykes f434c1f529
Feature: Support Multiple URLs in Studios (#6223)
* Backend support for studio URLs
* FrontEnd addition
* Support URLs in BulkStudioUpdate
* Update tagger modal for URLs
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2025-11-10 14:34:21 +11:00

24 lines
542 B
SQL

CREATE TABLE `studio_urls` (
`studio_id` integer NOT NULL,
`position` integer NOT NULL,
`url` varchar(255) NOT NULL,
foreign key(`studio_id`) references `studios`(`id`) on delete CASCADE,
PRIMARY KEY(`studio_id`, `position`, `url`)
);
CREATE INDEX `studio_urls_url` on `studio_urls` (`url`);
INSERT INTO `studio_urls`
(
`studio_id`,
`position`,
`url`
)
SELECT
`id`,
'0',
`url`
FROM `studios`
WHERE `studios`.`url` IS NOT NULL AND `studios`.`url` != '';
ALTER TABLE `studios` DROP COLUMN `url`;