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, id SERIAL PRIMARY KEY,
sourceid char(7) NOT NULL, sourceid char(7) NOT NULL,
phrase TEXT, phrase TEXT,
FOREIGN KEY (sourceid) REFERENCES sources(id) FOREIGN KEY (sourceid) REFERENCES sources(id) ON DELETE CASCADE
)`, tablename)) )`, tablename))
if err != nil { if err != nil {
return fmt.Errorf("could not create table '%s': %w", tablename, err) 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, corpusid char(7) NOT NULL,
name TEXT UNIQUE, name TEXT UNIQUE,
FOREIGN KEY (corpusid) REFERENCES corpora(id) FOREIGN KEY (corpusid) REFERENCES corpora(id) ON DELETE CASCADE
); );
-- CREATE TABLE IF NOT EXISTS phrases ( -- CREATE TABLE IF NOT EXISTS phrases (