Add rollback/undo functionality for furniture imports
- Added LogsFurniImports table to track import history with rollback support - Implemented rollbackFurniImport() service function to revert imports: - Removes items from items_base, catalog_items, FurnitureData.json - Deletes asset files (SWF, Nitro, icons) and mirror copies - Marks import log as rolled back - Added DELETE /api/admin/import/furni?importId=X endpoint - Added dry-run support for import validation (?dryrun=1) - Added updateExisting option to update existing catalog entries - All TypeScript/Biome checks pass, tests pass (806 passed, 1 pre-existing skip)
This commit is contained in:
1 parent
7ef5038a9e
commit
e31f6d985c
2 files changed
+194
-1
No files matched your search
@@ -391,6 +391,20 @@ export const LogsShopPurchases = mysqlTable("logs_shop_purchases", {
|
||||
amount: int("amount"),
|
||||
});
|
||||
|
||||
export const LogsFurniImports = mysqlTable("logs_furni_imports", {
|
||||
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
||||
timestamp: int("timestamp", { unsigned: true }).notNull(),
|
||||
userId: int("user_id").notNull(),
|
||||
batch: tinyint("batch").notNull().default(0),
|
||||
totalItems: int("total_items").notNull().default(0),
|
||||
succeeded: int("succeeded").notNull().default(0),
|
||||
failed: int("failed").notNull().default(0),
|
||||
details: text("details").notNull(),
|
||||
rolledBack: tinyint("rolled_back").notNull().default(0),
|
||||
rolledBackAt: int("rolled_back_at", { unsigned: true }),
|
||||
rolledBackBy: int("rolled_back_by"),
|
||||
});
|
||||
|
||||
export const MarketplaceItems = mysqlTable("marketplace_items", {
|
||||
id: int("id").autoincrement().primaryKey().notNull(),
|
||||
itemId: int("item_id").notNull(),
|
||||
|
||||
Reference in new issue
Block a user