@@ -26,7 +26,7 @@ def test_extract_single_column(fresh_db, table, fk_column):
2626 'CREATE TABLE "tree" (\n '
2727 " [id] INTEGER PRIMARY KEY,\n "
2828 " [name] TEXT,\n "
29- " [{}] INTEGER REFERENCES [{}]([id]),\n " .format (expected_fk , expected_table )
29+ " [{}] INTEGER REFERENCES [{}]([id]) ON UPDATE CASCADE ON DELETE CASCADE ,\n " .format (expected_fk , expected_table )
3030 + " [end] INTEGER\n "
3131 + ")"
3232 )
@@ -73,7 +73,7 @@ def test_extract_multiple_columns_with_rename(fresh_db):
7373 'CREATE TABLE "tree" (\n '
7474 " [id] INTEGER PRIMARY KEY,\n "
7575 " [name] TEXT,\n "
76- " [common_name_latin_name_id] INTEGER REFERENCES [common_name_latin_name]([id])\n "
76+ " [common_name_latin_name_id] INTEGER REFERENCES [common_name_latin_name]([id]) ON UPDATE CASCADE ON DELETE CASCADE \n "
7777 ")"
7878 )
7979 assert fresh_db ["common_name_latin_name" ].schema == (
@@ -123,7 +123,7 @@ def test_extract_rowid_table(fresh_db):
123123 assert fresh_db ["tree" ].schema == (
124124 'CREATE TABLE "tree" (\n '
125125 " [name] TEXT,\n "
126- " [common_name_latin_name_id] INTEGER REFERENCES [common_name_latin_name]([id])\n "
126+ " [common_name_latin_name_id] INTEGER REFERENCES [common_name_latin_name]([id]) ON UPDATE CASCADE ON DELETE CASCADE \n "
127127 ")"
128128 )
129129 assert (
@@ -153,14 +153,14 @@ def test_reuse_lookup_table(fresh_db):
153153 assert fresh_db ["sightings" ].schema == (
154154 'CREATE TABLE "sightings" (\n '
155155 " [id] INTEGER PRIMARY KEY,\n "
156- " [species_id] INTEGER REFERENCES [species]([id])\n "
156+ " [species_id] INTEGER REFERENCES [species]([id]) ON UPDATE CASCADE ON DELETE CASCADE \n "
157157 ")"
158158 )
159159 assert fresh_db ["individuals" ].schema == (
160160 'CREATE TABLE "individuals" (\n '
161161 " [id] INTEGER PRIMARY KEY,\n "
162162 " [name] TEXT,\n "
163- " [species_id] INTEGER REFERENCES [species]([id])\n "
163+ " [species_id] INTEGER REFERENCES [species]([id]) ON UPDATE CASCADE ON DELETE CASCADE \n "
164164 ")"
165165 )
166166 assert list (fresh_db ["species" ].rows ) == [
0 commit comments