diff --git a/lib/_data_ingestion/jmdict/seed_data.dart b/lib/_data_ingestion/jmdict/seed_data.dart index 950a810..b0e8255 100644 --- a/lib/_data_ingestion/jmdict/seed_data.dart +++ b/lib/_data_ingestion/jmdict/seed_data.dart @@ -219,8 +219,6 @@ Future seedJMDictData(List entries, Database db) async { b.insert(JMdictTableNames.senseSeeAlso, { 'senseId': s.senseId, 'xrefEntryId': resolvedEntry.entry.entryId, - 'seeAlsoKanji': xref.kanjiRef, - 'seeAlsoReading': xref.readingRef, 'seeAlsoSense': xref.senseOrderNum != null ? xref.senseOrderNum! - 1 : null, @@ -248,8 +246,6 @@ Future seedJMDictData(List entries, Database db) async { b.insert(JMdictTableNames.senseAntonyms, { 'senseId': s.senseId, 'xrefEntryId': resolvedEntry.entry.entryId, - 'antonymKanji': ant.kanjiRef, - 'antonymReading': ant.readingRef, 'antonymSense': ant.senseOrderNum != null ? ant.senseOrderNum! - 1 : null, diff --git a/migrations/0001_JMDict.sql b/migrations/0001_JMDict.sql index 37f4ce0..0782239 100644 --- a/migrations/0001_JMDict.sql +++ b/migrations/0001_JMDict.sql @@ -139,8 +139,6 @@ CREATE TABLE "JMdict_SenseRestrictedToReading" ( CREATE TABLE "JMdict_SenseSeeAlso" ( "senseId" INTEGER NOT NULL REFERENCES "JMdict_Sense"("senseId"), "xrefEntryId" INTEGER NOT NULL, - "seeAlsoReading" TEXT, - "seeAlsoKanji" TEXT, "seeAlsoSense" INTEGER, -- For some entries, the cross reference is ambiguous. This means that while the ingestion -- has determined some xrefEntryId, it is not guaranteed to be the correct one. @@ -153,18 +151,14 @@ CREATE TABLE "JMdict_SenseSeeAlso" ( END ) VIRTUAL, - FOREIGN KEY ("xrefEntryId", "seeAlsoKanji") REFERENCES "JMdict_KanjiElement"("entryId", "reading"), - FOREIGN KEY ("xrefEntryId", "seeAlsoReading") REFERENCES "JMdict_ReadingElement"("entryId", "reading"), FOREIGN KEY ("seeAlsoSenseKey") REFERENCES "JMdict_Sense"("senseId"), - UNIQUE("senseId", "xrefEntryId", "seeAlsoReading", "seeAlsoKanji", "seeAlsoSense") + PRIMARY KEY ("senseId", "xrefEntryId", "seeAlsoSense") ); CREATE TABLE "JMdict_SenseAntonym" ( "senseId" INTEGER NOT NULL REFERENCES "JMdict_Sense"("senseId"), "xrefEntryId" INTEGER NOT NULL, - "antonymReading" TEXT, - "antonymKanji" TEXT, "antonymSense" INTEGER, -- For some entries, the cross reference is ambiguous. This means that while the ingestion -- has determined some xrefEntryId, it is not guaranteed to be the correct one. @@ -177,11 +171,9 @@ CREATE TABLE "JMdict_SenseAntonym" ( END ) VIRTUAL, - FOREIGN KEY ("xrefEntryId", "antonymKanji") REFERENCES "JMdict_KanjiElement"("entryId", "reading"), - FOREIGN KEY ("xrefEntryId", "antonymReading") REFERENCES "JMdict_ReadingElement"("entryId", "reading"), FOREIGN KEY ("antonymSenseKey") REFERENCES "JMdict_Sense"("senseId"), - UNIQUE("senseId", "xrefEntryId", "antonymReading", "antonymKanji", "antonymSense") + PRIMARY KEY ("senseId", "xrefEntryId", "antonymSense") ); -- These cross references are going to be mostly accessed from a sense