cascades
This commit is contained in:
parent
a088db3c7b
commit
e60d00ae00
@ -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)
|
||||
|
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user