Skip to content

Commit 7062ff3

Browse files
committed
fix(seed): restore CAMPAIGN_YEARS_BACK after K8 rebase
1 parent 78332cb commit 7062ff3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/app/scripts/seed-conformite-stats.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ async function seed(sql) {
158158
insertedCompanies++;
159159
}
160160

161-
const totalYears = currentYear - FIRST_SEED_YEAR + 1;
162-
for (let yearsBack = 0; yearsBack < totalYears; yearsBack++) {
161+
for (let yearsBack = 0; yearsBack < CAMPAIGN_YEARS_BACK; yearsBack++) {
163162
const year = currentYear - yearsBack;
164163
let companyIndex = 0;
165164
for (const { siren, nafCode } of catalog) {
@@ -244,7 +243,7 @@ async function main() {
244243
}
245244
const result = await seed(sql);
246245
console.log(
247-
`[seed-conformite] upserted ${result.insertedCompanies} companies and ${result.insertedDeclarations} submitted declarations from ${FIRST_SEED_YEAR} to the current year.`,
246+
`[seed-conformite] upserted ${result.insertedCompanies} companies and ${result.insertedDeclarations} submitted declarations across ${CAMPAIGN_YEARS_BACK} campaign years.`,
248247
);
249248
console.log(
250249
`[seed-conformite] open http://localhost:3000/admin/stats/conformite to browse the tile.`,

0 commit comments

Comments
 (0)