From decfc0278c3f0284a90670151907be0975b3ee8c Mon Sep 17 00:00:00 2001 From: Silk Rose Date: Fri, 8 Mar 2024 23:44:04 -0500 Subject: [PATCH] Fix index table name for fimfic stats --- fimficstats/fimfic-stats.ts | 2 +- fimficstats/sql-patterns.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fimficstats/fimfic-stats.ts b/fimficstats/fimfic-stats.ts index 3be3ed2..86a56fc 100644 --- a/fimficstats/fimfic-stats.ts +++ b/fimficstats/fimfic-stats.ts @@ -9,7 +9,7 @@ import * as plib from "./lib.ts"; import fs from "fs"; const db = new Database("./fimfic-stats.db", { create: true }); -db.prepare(sql.index_table).run(); +db.prepare(sql.story_index_table).run(); db.prepare(sql.authors_table).run(); db.prepare(sql.stories_table).run(); db.prepare(sql.tags_table).run(); diff --git a/fimficstats/sql-patterns.ts b/fimficstats/sql-patterns.ts index c146a11..4f1c487 100644 --- a/fimficstats/sql-patterns.ts +++ b/fimficstats/sql-patterns.ts @@ -1,4 +1,4 @@ -export const index_table = `CREATE TABLE IF NOT EXISTS Index ( +export const story_index_table = `CREATE TABLE IF NOT EXISTS Story_index ( story_id integer PRIMARY KEY, status text NOT NULL, version integer NOT NULL, @@ -35,7 +35,7 @@ export const stories_table = `CREATE TABLE IF NOT EXISTS Stories ( REFERENCES Authors (id), CONSTRAINT story_index_id_fk FOREIGN KEY (id) - REFERENCES Index (story_id) + REFERENCES story_index (story_id) )`; export const tags_table = `CREATE TABLE IF NOT EXISTS Tags (