$ rm -f test.sqlite && python bug_models.py create && python bug_add.py && echo '.schema' | sqlite3 test.sqlite
CREATE TABLE "device" ("id" INTEGER NOT NULL PRIMARY KEY, "name" VARCHAR(20) NOT NULL, "owner_id" INTEGER, "network_id" INTEGER, FOREIGN KEY ("owner_id") REFERENCES "user" ("id"));
CREATE TABLE "network" ("id" INTEGER NOT NULL PRIMARY KEY, "name" TEXT NOT NULL);
CREATE TABLE "user" ("id" INTEGER NOT NULL PRIMARY KEY, "full_name" VARCHAR(128) NOT NULL);
CREATE INDEX "device_network_id" ON "device" ("network_id");
CREATE INDEX "device_owner_id" ON "device" ("owner_id");
$ rm -f test.sqlite && python bug_models.py create && python bug_drop.py
…
peewee.OperationalError: unknown column "owner_id" in foreign key definition