github.com/sharovik/devbot@v1.0.1-0.20240308094637-4a0387c40516/documentation/migrations.md (about)

     1  # Migrations
     2  There is a possibility to use migrations functionality in the project. This can help you to update your custom event features, play with the database of the devbot.
     3  Currently, there is only one way how to trigger the migrations for your event or for project itself - using the `container.C.MigrationService` service.
     4  
     5  ### How to use
     6  Inside of container there is service.MigrationService injected. So you can use available functionality from that service in your event by simply calling `container.C.MigrationService.SetMigration(migration)`.
     7  
     8  `SetMigration` - method for scheduling of your migration for execution. As attribute, it receives an object type of `database.BaseMigrationInterface`
     9  `RunMigrations` - method will run all the migrations which were prepared for execution.
    10  
    11  See the example in `Update` method of `events/eventslist/event.go` event.