mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 02:01:31 +00:00
refactor: only store migrations if not already ran
This commit is contained in:
@@ -16,7 +16,7 @@ for esxVersion, migrations in pairs(Core.Migrations or {}) do
|
||||
---@cast esxVersion string
|
||||
---@cast migrations table<string, function>
|
||||
|
||||
if GetResourceKvpInt(("esx_migration:%s"):format(esxVersion)) ~= 1 then
|
||||
if ESX.Table.SizeOf(migrations) > 0 then
|
||||
print(("^4[INFO]^7 Running migrations for ESX version %s"):format(esxVersion))
|
||||
|
||||
for migrationName, migration in pairs(migrations) do
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
Core.Migrations = Core.Migrations or {}
|
||||
Core.Migrations["v1.13.3"] = Core.Migrations["v1.13.3"] or {}
|
||||
local esxVersion = "v1.13.3"
|
||||
|
||||
Core.Migrations["v1.13.3"].ssn = function()
|
||||
Core.Migrations = Core.Migrations or {}
|
||||
Core.Migrations[esxVersion] = Core.Migrations[esxVersion] or {}
|
||||
|
||||
if GetResourceKvpInt(("esx_migration:%s"):format(esxVersion)) == 1 then
|
||||
return
|
||||
end
|
||||
|
||||
Core.Migrations[esxVersion].ssn = function()
|
||||
print("^4[esx_migration:v.1.13.3:ssn]^7 Adding SSN column to users table.")
|
||||
local col = MySQL.scalar.await([[
|
||||
SELECT COUNT(*)
|
||||
|
||||
Reference in New Issue
Block a user