Added 1B, 2 and added bootstrap again for site
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { CircuitListRepository } from "../src/db/repositories/circuit-list.repository.js";
|
||||
import { CircuitSectionRepository } from "../src/db/repositories/circuit-section.repository.js";
|
||||
import { ProjectRepository } from "../src/db/repositories/project.repository.js";
|
||||
|
||||
const projectRepository = new ProjectRepository();
|
||||
const circuitListRepository = new CircuitListRepository();
|
||||
const circuitSectionRepository = new CircuitSectionRepository();
|
||||
|
||||
async function run() {
|
||||
const projects = await projectRepository.list();
|
||||
let totalLists = 0;
|
||||
for (const project of projects) {
|
||||
const lists = await circuitListRepository.listByProject(project.id);
|
||||
for (const list of lists) {
|
||||
await circuitSectionRepository.createDefaults(list.id);
|
||||
totalLists += 1;
|
||||
}
|
||||
}
|
||||
console.log(`Section backfill done for ${totalLists} circuit list(s).`);
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
console.error("Section backfill failed:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user