From fc51ff9e22a809e257ae92f12272f1dbcb31f594 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 22 Aug 2024 22:25:57 +0200 Subject: Add position type and query on it --- schema/init.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'schema/init.sql') diff --git a/schema/init.sql b/schema/init.sql index 38d1e80..f2bc431 100644 --- a/schema/init.sql +++ b/schema/init.sql @@ -5,3 +5,13 @@ CREATE TABLE users( is_admin boolean default false, PRIMARY KEY (id) ); + +CREATE TABLE positions( + id SERIAL NOT NULL, + user_id INTEGER NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + location GEOGRAPHY(Point, 4326) NOT NULL, + PRIMARY KEY(id), + CONSTRAINT fk_users_id + FOREIGN KEY(user_id) REFERENCES users(id) +); -- cgit v1.2.3-18-g5258