Sha256: c8dc713c7d91bf5dc0b0258d2b9a974a3d7a1ddedee381e1d6fdcd5ee4b0f4db
Contents?: true
Size: 911 Bytes
Versions: 33
Compression:
Stored size: 911 Bytes
Contents
class DocumentsKpathChange < ActiveRecord::Migration def self.up # this could break on paths like 'NNPD' (Note <- News <- Post <- Dobidou). But it's very unlikely to be # widespread and we haven't released anything yet (pre-alpha). execute "UPDATE nodes SET kpath = REPLACE(kpath, 'NPD', 'ND')" execute "UPDATE template_contents SET tkpath = REPLACE(tkpath, 'NPD', 'ND')" execute "UPDATE relations SET target_kpath = REPLACE(target_kpath, 'NPD', 'ND')" execute "UPDATE relations SET source_kpath = REPLACE(source_kpath, 'NPD', 'ND')" end def self.down execute "UPDATE nodes SET kpath = REPLACE(kpath, 'ND', 'NPD')" execute "UPDATE template_contents SET tkpath = REPLACE(tkpath, 'ND', 'NPD')" execute "UPDATE relations SET target_kpath = REPLACE(target_kpath, 'ND', 'NPD')" execute "UPDATE relations SET source_kpath = REPLACE(source_kpath, 'ND', 'NPD')" end end
Version data entries
33 entries across 33 versions & 1 rubygems