message: Add persistent test for DROP COLUMN as well
diff: @@ -103,3 +103,40 @@ TEST_CASE("Add column to persistent table", "[storage]") {
  }
  DeleteDatabase(storage_database);
  }
  +
  +TEST_CASE("Remove column from persistent table", "[storage]") {
  + unique_ptr<QueryResult> result;
  + auto storage_database = TestCreatePath("storage_test");
  + auto config = GetTestConfig();
  +
  + // make sure the database does not exist
  + DeleteDatabase(storage_database);
  + {
  + // create a database and insert values
  + DuckDB db(storage_database, config.get());
  + Connection con(db);
  + REQUIRE_NO_FAIL(con.Query("CREATE TABLE test (a INTEGER, b INTEGER);"));
  + REQUIRE_NO_FAIL(con.Query("INSERT INTO test VALUES (11, 22), (13, 22), (12, 21)"));
  + }
  + // reload and alter
  + {
  + DuckDB db(storage_database, config.get());
  + Connection con(db);
  +
  + REQUIRE_NO_FAIL(con.Query("ALTER TABLE test DROP COLUMN b"));
  +
  + result = con.Query("SELECT * FROM test ORDER BY 1");
  + REQUIRE(CHECK_COLUMN(result, 0, {11, 12, 13}));
  + REQUIRE(result->names.size() == 1);
  + }
  + // now reload
  + for(idx_t i = 0; i < 2; i++) {
  + DuckDB db(storage_database, config.get());
  + Connection con(db);
  +
  + result = con.Query("SELECT * FROM test ORDER BY 1");
  + REQUIRE(CHECK_COLUMN(result, 0, {11, 12, 13}));
  + REQUIRE(result->names.size() == 1);
  + }
  + DeleteDatabase(storage_database);
  +}
  