Skip to content

Instantly share code, notes, and snippets.

@naoaki011
Created October 17, 2018 05:33
Show Gist options
  • Save naoaki011/9d0985b87f8143c308afa52cdb74ad55 to your computer and use it in GitHub Desktop.
Save naoaki011/9d0985b87f8143c308afa52cdb74ad55 to your computer and use it in GitHub Desktop.
SQLでファイルパスに含まれる「\」を「/」に変更する
#アイテムテーブル
UPDATE `mt_asset` SET `asset_file_path` = REPLACE(`asset_file_path`, '\\', '\/') WHERE `asset_file_path` REGEXP '\\\\' ;
#FileInfoテーブル
UPDATE `mt_fileinfo` SET `fileinfo_file_path` = REPLACE(`fileinfo_file_path`, 'D:\\inetpub\\wwwroot', '\/powercms\/data\/sites\/01\/files') WHERE `fileinfo_file_path` REGEXP '\\\\';
UPDATE `mt_fileinfo` SET `fileinfo_file_path` = REPLACE(`fileinfo_file_path`, '\\', '\/') WHERE `fileinfo_file_path` REGEXP '\\\\';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment