Last active
May 7, 2021 19:20
-
-
Save RomikMakavana/c72cd2bb28ad46fa323d09719972ac41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CreateFunctionDoublequote extends Migration | |
{ | |
public function up() | |
{ | |
$query = <<<EOD | |
CREATE FUNCTION `DOUBLEQUOTE`(`val` TEXT) RETURNS TEXT CHARSET latin1 NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER RETURN CONCAT('"', REPLACE(val, '"', '\"'), '"') | |
EOD; | |
DB::unprepared($query); | |
} | |
public function down() | |
{ | |
DB::unprepared('DROP FUNCTION IF EXISTS DOUBLEQUOTE'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment