From f42a2cf570f6447158ff7d72da28aca9692262e5 Mon Sep 17 00:00:00 2001 From: Kyler Chin <7539174+kylerchin@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:25:13 -0700 Subject: [PATCH] switch tile x and y to i32 --- migrations/2024-11-01-080726_tile_cache/up.sql | 4 ++-- src/models.rs | 4 ++-- src/schema.rs | 4 ++-- src/tile_save_and_get.rs | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/migrations/2024-11-01-080726_tile_cache/up.sql b/migrations/2024-11-01-080726_tile_cache/up.sql index 48839aec..da9b5312 100644 --- a/migrations/2024-11-01-080726_tile_cache/up.sql +++ b/migrations/2024-11-01-080726_tile_cache/up.sql @@ -2,8 +2,8 @@ CREATE TABLE gtfs.tile_storage ( category smallint not null, z smallint not null, - x smallint not null, - y smallint not null, + x int not null, + y int not null, mvt_data bytea not null, added_time Timestamptz not null, diff --git a/src/models.rs b/src/models.rs index 384911e4..65d70fdf 100644 --- a/src/models.rs +++ b/src/models.rs @@ -418,8 +418,8 @@ pub struct IpToGeoAddr { pub struct TileStorage { pub category: i16, pub z: i16, - pub x: i16, - pub y: i16, + pub x: i32, + pub y: i32, pub mvt_data: Vec, pub added_time: chrono::DateTime } \ No newline at end of file diff --git a/src/schema.rs b/src/schema.rs index 4159ab5d..3b9e508d 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -465,8 +465,8 @@ pub mod gtfs { gtfs.tile_storage (category, z, x, y) { category -> Int2, z -> Int2, - x -> Int2, - y -> Int2, + x -> Int4, + y -> Int4, mvt_data -> Bytea, added_time -> Timestamptz, } diff --git a/src/tile_save_and_get.rs b/src/tile_save_and_get.rs index e69de29b..4524ae48 100644 --- a/src/tile_save_and_get.rs +++ b/src/tile_save_and_get.rs @@ -0,0 +1,3 @@ +pub fn insert_tile(z: i16, x: i32, y: i32) { + +} \ No newline at end of file