Skip to content

Commit 22b4e8e

Browse files
authored
Merge branch 'main' into local-dev-docker-compose
2 parents 877a739 + a618cca commit 22b4e8e

File tree

5 files changed

+52
-43
lines changed

5 files changed

+52
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ To test the HIBP breach alerts endpoint, use:
269269
```sh
270270
export SERVER_URL=...
271271
export HIBP_NOTIFY_TOKEN=...
272-
npm run loadtest:hbibp-webhook
272+
npm run loadtest:hibp-webhook
273273
```
274274

275275
You can customise the number of requests to send in parallel ("virtual users") by setting the

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@types/react-dom": "19.1.7",
9393
"canvas-confetti": "^1.9.3",
9494
"dotenv-flow": "^4.1.0",
95-
"ioredis": "^5.6.1",
95+
"ioredis": "^5.7.0",
9696
"jsdom": "^27.0.0",
9797
"jsonwebtoken": "^9.0.2",
9898
"jwk-to-pem": "^2.0.7",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
/**
6+
* @param { import("knex").Knex } knex
7+
* @returns { Promise<void> }
8+
*/
9+
export async function up(knex) {
10+
await knex.schema.dropTableIfExists("subscriber_churns");
11+
await knex.schema.dropTableIfExists("subscriber_coupons");
12+
}
13+
14+
/**
15+
* @param { import("knex").Knex } knex
16+
* @returns { Promise<void> }
17+
*/
18+
export async function down(knex) {
19+
await knex.schema.createTable("subscriber_churns", function (table) {
20+
table.increments("id").primary();
21+
table.string("userid").unique();
22+
table.string("customer").unique();
23+
table.string("plan_id");
24+
table.string("product_id");
25+
table.string("intervl");
26+
table.string("nickname");
27+
table.timestamp("created");
28+
table.timestamp("current_period_end");
29+
});
30+
await knex.schema.createTable("subscriber_coupons", (table) => {
31+
table.increments("id").primary();
32+
table
33+
.integer("subscriber_id")
34+
.references("subscribers.id")
35+
.notNullable()
36+
.onDelete("CASCADE")
37+
.onUpdate("CASCADE");
38+
table.string("coupon_code").notNullable();
39+
table.timestamp("created_at").defaultTo(knex.fn.now());
40+
table.unique(["subscriber_id", "coupon_code"]);
41+
});
42+
}

src/knex-tables.d.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ declare module "knex/types/tables" {
2626
updated_at: Date;
2727
}
2828

29-
interface SubscriberChurnRow {
30-
userid: string;
31-
customer: string;
32-
nickname: string;
33-
intervl: string;
34-
plan_id: string;
35-
product_id: string;
36-
current_period_end: Date;
37-
}
38-
3929
interface OnerepScanResultDataBrokerRow extends OnerepScanResultRow {
4030
scan_result_status: RemovalStatus;
4131
broker_status: DataBrokerRemovalStatus;
@@ -213,17 +203,6 @@ declare module "knex/types/tables" {
213203
"id" | "created_at" | "updated_at"
214204
>;
215205

216-
interface SubscriberCouponRow {
217-
id: number;
218-
subscriber_id: number;
219-
coupon_code: string;
220-
created_at: Date;
221-
}
222-
type SubscriberCouponAutoInsertedColumns = Extract<
223-
keyof SubscriberCouponRow,
224-
"id" | "subscriber_id" | "created_at"
225-
>;
226-
227206
interface SubscriberEmailPreferencesRow {
228207
id: number;
229208
subscriber_id: number;
@@ -530,18 +509,6 @@ declare module "knex/types/tables" {
530509
>
531510
>;
532511

533-
subscriber_coupons: Knex.CompositeTableType<
534-
SubscriberCouponRow,
535-
// On inserts, auto-generated columns cannot be set, and nullable columns are optional:
536-
WritableDateColumns<
537-
Omit<SubscriberCouponRow, SubscriberAutoInsertedColumns>
538-
>,
539-
// On updates, don't allow updating the ID; all other fields are optional:
540-
WritableDateColumns<Partial<Omit<SubscriberCouponRow, "id">>>
541-
>;
542-
543-
subscriber_churns: SubscriberChurnRow;
544-
545512
subscriber_email_preferences: Knex.CompositeTableType<
546513
SubscriberEmailPreferencesRow,
547514
// On inserts, auto-generated columns cannot be set, and nullable columns are optional:

0 commit comments

Comments
 (0)