Index: src/gpkgCreateBaseTables.c ================================================================== --- src/gpkgCreateBaseTables.c +++ src/gpkgCreateBaseTables.c @@ -55,17 +55,10 @@ char *errMsg = NULL; int ret = 0; int i = 0; const char* tableSchemas[] = { - "CREATE TABLE geopackage_contents (\n" - "table_name TEXT NOT NULL PRIMARY KEY,\n" - "data_type TEXT NOT NULL,\n" - "identifier TEXT NOT NULL DEFAULT '',\n" - "description TEXT NOT NULL DEFAULT '',\n" - "last_change TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ',CURRENT_TIMESTAMP)));", - /* GeoPackage specification Table 19/20 */ "CREATE TABLE raster_columns (\n" "r_table_name TEXT NOT NULL,\n" "r_raster_column TEXT NOT NULL,\n" "srid INTEGER NOT NULL DEFAULT 0,\n" @@ -119,10 +112,14 @@ /* GeoPackage specification Table 23/24 */ /* TODO: see if there is a nicer way to manage this using a VIEW */ "CREATE TABLE tile_table_metadata (\n" "t_table_name TEXT NOT NULL PRIMARY KEY,\n" + "min_x DOUBLE NOT NULL DEFAULT -180.0,\n" + "min_y DOUBLE NOT NULL DEFAULT -90.0,\n" + "max_x DOUBLE NOT NULL DEFAULT 180.0,\n" + "max_y DOUBLE NOT NULL DEFAULT 90.0 ,\n" "is_times_two_zoom INTEGER NOT NULL DEFAULT 1\n" ");", /* The next four triggers are from GeoPackage specification Table 25 */ "CREATE TRIGGER 'tile_table_metadata_t_table_name_insert'\n" @@ -376,15 +373,10 @@ "FOR EACH ROW BEGIN\n" "SELECT RAISE(ROLLBACK, 'update on table metadata_reference violates constraint: timestamp must be a valid time in ISO 8601 \"yyyy-mm-ddThh-mm-ss.cccZ\" form')\n" "WHERE NOT (NEW.timestamp GLOB '[1-2][0-9][0-9][0-9]-[0-1][0-9]-[1-3][1-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]Z'\n" "AND strftime('%s',NEW.timestamp) NOT NULL);\n" "END;", - - "CREATE TABLE manifest (\n" - "id TEXT NOT NULL PRIMARY KEY,\n" - "manifest TEXT NOT NULL\n" - ");", NULL }; for (i = 0; tableSchemas[i] != NULL; ++i) Index: test/check_createBaseTables.c ================================================================== --- test/check_createBaseTables.c +++ test/check_createBaseTables.c @@ -94,11 +94,11 @@ sqlite3_free (err_msg); return -101; } /* check tile_table_metadata table is OK */ - ret = sqlite3_exec (db_handle, "INSERT INTO tile_table_metadata VALUES (\"sample_matrix_tiles\", 1)", NULL, NULL, &err_msg); + ret = sqlite3_exec (db_handle, "INSERT INTO tile_table_metadata VALUES (\"sample_matrix_tiles\", -179.0, -89.0, 179.0, 89.0, 1)", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf(stderr, "Unexpected INSERT INTO tile_table_metadata result: %i, (%s)\n", ret, err_msg); sqlite3_free (err_msg); return -102; } @@ -158,11 +158,11 @@ ret = sqlite3_exec (db_handle, "SELECT gpkgCreateBaseTables()", NULL, NULL, &err_msg); if (ret != SQLITE_ERROR) { fprintf(stderr, "Unexpected duplicate gpkgCreateBaseTables() result: %i, (%s)\n", ret, err_msg); return -110; } - if (strcmp("table geopackage_contents already exists", err_msg) != 0) + if (strcmp("table raster_columns already exists", err_msg) != 0) { fprintf(stderr, "Unexpected duplicate gpkgCreateBaseTables() error message: %s\n", err_msg); return -111; } sqlite3_free (err_msg);