SQLite Forum

DROP COLUMN on indexed column doesn't raise an error
Login
I can reproduce your bug even with this less perplexing DDL:<code>
  CREATE TABLE "test_models" ("x y", "z 1", "a b");
  ALTER TABLE "test_models" ADD "hat_name" varchar;
  CREATE INDEX "index_test_models_on_hat_name" ON "test_models" ("hat_name");
  ALTER TABLE "test_models" DROP COLUMN "hat_name";
</code>At that point, .schema shows:<code>
CREATE TABLE IF NOT EXISTS "test_models" ("x y", "z 1", "a b");
CREATE INDEX "index_test_models_on_hat_name" ON "test_models" ("hat_name");
</code>, which is clearly nonsensical.