mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 21:35:19 +00:00
feat: backup + restore
This commit is contained in:
46
models/backups.ts
Normal file
46
models/backups.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { prisma } from "@/lib/db"
|
||||
|
||||
type ModelEntry = {
|
||||
filename: string
|
||||
model: any
|
||||
idField: string
|
||||
}
|
||||
|
||||
// Ordering is important here
|
||||
export const MODEL_BACKUP: ModelEntry[] = [
|
||||
{
|
||||
filename: "settings.json",
|
||||
model: prisma.setting,
|
||||
idField: "code",
|
||||
},
|
||||
{
|
||||
filename: "currencies.json",
|
||||
model: prisma.currency,
|
||||
idField: "code",
|
||||
},
|
||||
{
|
||||
filename: "categories.json",
|
||||
model: prisma.category,
|
||||
idField: "code",
|
||||
},
|
||||
{
|
||||
filename: "projects.json",
|
||||
model: prisma.project,
|
||||
idField: "code",
|
||||
},
|
||||
{
|
||||
filename: "fields.json",
|
||||
model: prisma.field,
|
||||
idField: "code",
|
||||
},
|
||||
{
|
||||
filename: "files.json",
|
||||
model: prisma.file,
|
||||
idField: "id",
|
||||
},
|
||||
{
|
||||
filename: "transactions.json",
|
||||
model: prisma.transaction,
|
||||
idField: "id",
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user