mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
refactor: store migrations in core table
This commit is contained in:
@@ -4,7 +4,7 @@ RegisterCommand("resetmigrations", function(src)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
for version, _ in pairs(Migrations or {}) do
|
for version, _ in pairs(Core.Migrations or {}) do
|
||||||
DeleteResourceKvp(("esx_migration:%s"):format(version))
|
DeleteResourceKvp(("esx_migration:%s"):format(version))
|
||||||
end
|
end
|
||||||
print("^2[SUCCESS]^7 Reset all migrations. This will re-run all migrations on the next server start.")
|
print("^2[SUCCESS]^7 Reset all migrations. This will re-run all migrations on the next server start.")
|
||||||
@@ -12,7 +12,7 @@ end)
|
|||||||
|
|
||||||
local migrationsRan = 0
|
local migrationsRan = 0
|
||||||
|
|
||||||
for esxVersion, migrations in pairs(Migrations or {}) do
|
for esxVersion, migrations in pairs(Core.Migrations or {}) do
|
||||||
---@cast esxVersion string
|
---@cast esxVersion string
|
||||||
---@cast migrations table<string, function>
|
---@cast migrations table<string, function>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Migrations = Migrations or {}
|
Core.Migrations = Core.Migrations or {}
|
||||||
Migrations["v1.13.3"] = Migrations["v1.13.3"] or {}
|
Core.Migrations["v1.13.3"] = Core.Migrations["v1.13.3"] or {}
|
||||||
|
|
||||||
Migrations["v1.13.3"].ssn = function()
|
Core.Migrations["v1.13.3"].ssn = function()
|
||||||
print("^4[esx_migration:v.1.13.3:ssn]^7 Adding SSN column to users table.")
|
print("^4[esx_migration:v.1.13.3:ssn]^7 Adding SSN column to users table.")
|
||||||
local col = MySQL.scalar.await([[
|
local col = MySQL.scalar.await([[
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
|
|||||||
Reference in New Issue
Block a user