<s> """<STR_LIT>""" <EOL> from alembic import op <EOL> import sqlalchemy as sa <EOL> from pyramid . location import lineage <EOL> revision = '<STR_LIT>' <EOL> down_revision = '<STR_LIT>' <EOL> def upgrade ( ) : <EOL> from alembic . context import get_bind <EOL> conn = get_bind ( ) <EOL> if conn . engine . dialect . name == '<STR_LIT>' : <EOL> op . add_column ( '<STR_LIT>' , sa . Column ( '<STR_LIT:path>' , sa . Unicode ( <NUM_LIT:1000> ) ) ) <EOL> else : <EOL> op . add_column ( '<STR_LIT>' , sa . Column ( '<STR_LIT:path>' , sa . Unicode ( <NUM_LIT:1000> ) , index = True ) ) <EOL> from kotti import DBSession <EOL> from kotti . resources import Node <EOL> for node in DBSession . query ( Node ) . with_polymorphic ( [ Node ] ) : <EOL> reversed_lineage = reversed ( tuple ( lineage ( node ) ) ) <EOL> node . path = u'<STR_LIT:/>' . join ( <EOL> node . __name__ for node in reversed_lineage ) or u'<STR_LIT:/>' <EOL> def downgrade ( ) : <EOL> op . drop_column ( '<STR_LIT>' , '<STR_LIT:path>' ) </s>
