Question

Photo of Jorge Recio

0

Core migrations and custom indexes

Hi,

Is there any risk in creating new custom indexes or modifying existing ones on Rock core tables, such as losing these during a migration? If so what would be the best way to avoid this?

Thank you

  • Photo of Scott Conger

    0

    Jorge,

    You can add your own indexes; however, they should be uniquely named for your organization.  If your new index has too common of a name, a future migration could introduce the same index name which would result in a migration crashing.  I'd suggest putting your church's initials on beginning of index name.

    I would not suggest modifying any existing Rock indexes.  If there is truly an index missing that impacts the whole community, create a migration and a pull request, instead.

    If you want to see how Rock's migrations change indexes, you can search the Rock.Migration GitHub folder for "drop index" or "create index" like this: https://github.com/SparkDevNetwork/Rock/search?utf8=%E2%9C%93&q=drop+index&type=Code