audit: drop the audit_links table (#416)
This commit is contained in:
parent
1e8a924c4c
commit
8d6e99385f
1
drizzle-pg/0015_sticky_dagger.sql
Normal file
1
drizzle-pg/0015_sticky_dagger.sql
Normal file
@ -0,0 +1 @@
|
||||
DROP TABLE "audit_links" CASCADE;
|
||||
3605
drizzle-pg/meta/0015_snapshot.json
Normal file
3605
drizzle-pg/meta/0015_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -106,6 +106,13 @@
|
||||
"when": 1784588248793,
|
||||
"tag": "0014_solid_centennial",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 15,
|
||||
"version": "7",
|
||||
"when": 1784610564142,
|
||||
"tag": "0015_sticky_dagger",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
1
drizzle/0038_happy_steel_serpent.sql
Normal file
1
drizzle/0038_happy_steel_serpent.sql
Normal file
@ -0,0 +1 @@
|
||||
DROP TABLE `audit_links`;
|
||||
3290
drizzle/meta/0038_snapshot.json
Normal file
3290
drizzle/meta/0038_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -267,6 +267,13 @@
|
||||
"when": 1784588247803,
|
||||
"tag": "0037_small_caretaker",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 38,
|
||||
"version": "6",
|
||||
"when": 1784610563184,
|
||||
"tag": "0038_happy_steel_serpent",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -123,36 +123,8 @@ export const auditPages = sqliteTable(
|
||||
(table) => [index("audit_pages_audit_url_idx").on(table.auditId, table.url)],
|
||||
);
|
||||
|
||||
// One row per unique (source page, target URL) link edge. Currently only
|
||||
// internal edges are stored (see AuditRepository); isInternal stays so
|
||||
// external-link checks can start writing rows without a migration.
|
||||
export const auditLinks = sqliteTable(
|
||||
"audit_links",
|
||||
{
|
||||
id: text("id").primaryKey(),
|
||||
auditId: text("audit_id")
|
||||
.notNull()
|
||||
.references(() => audits.id, { onDelete: "cascade" }),
|
||||
sourcePageId: text("source_page_id")
|
||||
.notNull()
|
||||
.references(() => auditPages.id, { onDelete: "cascade" }),
|
||||
sourceUrl: text("source_url").notNull(),
|
||||
targetUrl: text("target_url").notNull(),
|
||||
anchor: text("anchor"),
|
||||
isInternal: integer("is_internal", { mode: "boolean" })
|
||||
.notNull()
|
||||
.default(true),
|
||||
isNofollow: integer("is_nofollow", { mode: "boolean" })
|
||||
.notNull()
|
||||
.default(false),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_links_audit_target_idx").on(table.auditId, table.targetUrl),
|
||||
// Cascade path from audit_pages deletes; without this every page delete
|
||||
// seq-scans the (large) links table.
|
||||
index("audit_links_source_page_id_idx").on(table.sourcePageId),
|
||||
],
|
||||
);
|
||||
// Link edges live in the per-audit AuditScratchpad Durable Object for the
|
||||
// duration of the crawl; they are never persisted to the app DB.
|
||||
|
||||
// One row per (issue type, affected page)
|
||||
export const auditIssues = sqliteTable(
|
||||
|
||||
@ -122,32 +122,8 @@ export const auditPages = pgTable(
|
||||
(table) => [index("audit_pages_audit_url_idx").on(table.auditId, table.url)],
|
||||
);
|
||||
|
||||
// One row per unique (source page, target URL) link edge. Currently only
|
||||
// internal edges are stored (see AuditRepository); isInternal stays so
|
||||
// external-link checks can start writing rows without a migration.
|
||||
export const auditLinks = pgTable(
|
||||
"audit_links",
|
||||
{
|
||||
id: text("id").primaryKey(),
|
||||
auditId: text("audit_id")
|
||||
.notNull()
|
||||
.references(() => audits.id, { onDelete: "cascade" }),
|
||||
sourcePageId: text("source_page_id")
|
||||
.notNull()
|
||||
.references(() => auditPages.id, { onDelete: "cascade" }),
|
||||
sourceUrl: text("source_url").notNull(),
|
||||
targetUrl: text("target_url").notNull(),
|
||||
anchor: text("anchor"),
|
||||
isInternal: boolean("is_internal").notNull().default(true),
|
||||
isNofollow: boolean("is_nofollow").notNull().default(false),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_links_audit_target_idx").on(table.auditId, table.targetUrl),
|
||||
// Cascade path from audit_pages deletes; without this every page delete
|
||||
// seq-scans the (large) links table.
|
||||
index("audit_links_source_page_id_idx").on(table.sourcePageId),
|
||||
],
|
||||
);
|
||||
// Link edges live in the per-audit AuditScratchpad Durable Object for the
|
||||
// duration of the crawl; they are never persisted to the app DB.
|
||||
|
||||
// One row per (issue type, affected page)
|
||||
export const auditIssues = pgTable(
|
||||
|
||||
@ -77,7 +77,6 @@ export const {
|
||||
backlinkSnapshots,
|
||||
audits,
|
||||
auditPages,
|
||||
auditLinks,
|
||||
auditIssues,
|
||||
auditLighthouseResults,
|
||||
samSessions,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user