REE.Lib.DB.Migrations - REE-FiveM/ree-core GitHub Wiki

REE.Lib.DB.Migrations INTERNAL

CreateMigrationTable()

This will run the migrations required for ree-core to start properly. This table is also used for storing migration revision info for external plugins. There are no parameters and nothing is returned.

GetActivePluginMigrationVersion(pluginName)

Retrieves the current revision for a given plugin, if not found will return nil.

Parameters:

  • pluginName (string) - The name of the plugin

Returns: number | nil

RegisterPluginMigration(pluginName)

This will insert a row into the migrations table for a plugin of this name. The revision will be 0, and all migrations IDs must at least be 1.

Parameters:

  • pluginName (string) - The name of the plugin

RegisterPluginMigrationRevision(pluginName, id, query)

Adds a migration and it's SQL query to the internal list of migrations.

Parameters:

  • pluginName (string) - The name of the plugin
  • id (number) - The migration ID
  • query (string) - The SQL query to execute

RunAllPluginMigrations(pluginName)

This will run all migrations that need to be run for a given plugin.

Parameters:

  • pluginName (string) - The name of the plugin