This commit is contained in:
nate smith 2024-08-17 14:31:52 -05:00
parent a088db3c7b
commit e60d00ae00
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ func Ingest(o IngestOpts) error {
id SERIAL PRIMARY KEY,
sourceid char(7) NOT NULL,
phrase TEXT,
FOREIGN KEY (sourceid) REFERENCES sources(id)
FOREIGN KEY (sourceid) REFERENCES sources(id) ON DELETE CASCADE
)`, tablename))
if err != nil {
return fmt.Errorf("could not create table '%s': %w", tablename, err)

View File

@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS sources (
corpusid char(7) NOT NULL,
name TEXT UNIQUE,
FOREIGN KEY (corpusid) REFERENCES corpora(id)
FOREIGN KEY (corpusid) REFERENCES corpora(id) ON DELETE CASCADE
);
-- CREATE TABLE IF NOT EXISTS phrases (