mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Escape single quotes in migration 8
This commit is contained in:
parent
a389fa7178
commit
a1bd87098c
@ -1,7 +1,9 @@
|
|||||||
class RelativePath < MG::Base
|
class RelativePath < MG::Base
|
||||||
def up : String
|
def up : String
|
||||||
base = Config.current.library_path
|
base = Config.current.library_path
|
||||||
base = base[...-1] if base.ends_with? "/"
|
# Escape single quotes in case the path contains them, and remove the
|
||||||
|
# trailing slash (this is a mistake, fixed in DB version 10)
|
||||||
|
base = base.gsub("'", "''").rstrip "/"
|
||||||
|
|
||||||
<<-SQL
|
<<-SQL
|
||||||
-- update the path column in ids to relative paths
|
-- update the path column in ids to relative paths
|
||||||
@ -16,7 +18,7 @@ class RelativePath < MG::Base
|
|||||||
|
|
||||||
def down : String
|
def down : String
|
||||||
base = Config.current.library_path
|
base = Config.current.library_path
|
||||||
base = base[...-1] if base.ends_with? "/"
|
base = base.gsub("'", "''").rstrip "/"
|
||||||
|
|
||||||
<<-SQL
|
<<-SQL
|
||||||
-- update the path column in ids to absolute paths
|
-- update the path column in ids to absolute paths
|
||||||
|
Loading…
x
Reference in New Issue
Block a user