feat(silo): added in charts and historical data
This commit is contained in:
@@ -56,17 +56,17 @@ export const migrateAdjustments = async () => {
|
||||
/**
|
||||
* Migrate all the silo adjustments :D
|
||||
*/
|
||||
const silo: any = s?.data;
|
||||
const silo: any = s?.data.data;
|
||||
createLog("info", "silo", "logistics", "Starting migration.");
|
||||
for (let i = 0; i < silo.length; i++) {
|
||||
const migrate = await db.insert(siloAdjustments).values({
|
||||
warehouseID: silo[0].warehouseID,
|
||||
locationID: silo[0].locationID,
|
||||
currentStockLevel: silo[0].currentStockLevel,
|
||||
newLevel: silo[0].newLevel,
|
||||
dateAdjusted: new Date(silo[0].dateAdjusted),
|
||||
lastDateAdjusted: new Date(silo[0].lastDateAdjusted),
|
||||
add_user: silo[0].add_user,
|
||||
warehouseID: silo[i].warehouseID,
|
||||
locationID: silo[i].locationID,
|
||||
currentStockLevel: silo[i].currentStockLevel,
|
||||
newLevel: silo[i].newLevel,
|
||||
dateAdjusted: new Date(silo[i].dateAdjusted),
|
||||
lastDateAdjusted: new Date(silo[i].lastDateAdjusted),
|
||||
add_user: silo[i].add_user,
|
||||
});
|
||||
createLog(
|
||||
"info",
|
||||
@@ -87,5 +87,3 @@ export const migrateAdjustments = async () => {
|
||||
.where(eq(settings.name, "siloAdjMigrations"));
|
||||
createLog("info", "silo", "logistics", "Migration completed.");
|
||||
};
|
||||
|
||||
migrateAdjustments();
|
||||
|
||||
Reference in New Issue
Block a user