summaryrefslogtreecommitdiff
path: root/schema/init.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema/init.sql')
-rw-r--r--schema/init.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/schema/init.sql b/schema/init.sql
index f2bc431..682431c 100644
--- a/schema/init.sql
+++ b/schema/init.sql
@@ -6,11 +6,14 @@ CREATE TABLE users(
PRIMARY KEY (id)
);
+CREATE TYPE moving_activity AS ENUM ('InVehicle', 'OnFoot', 'Running', 'Walking', 'Still');
+
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,
+ activity moving_activity NOT NULL,
PRIMARY KEY(id),
CONSTRAINT fk_users_id
FOREIGN KEY(user_id) REFERENCES users(id)