diff options
Diffstat (limited to 'schema')
-rw-r--r-- | schema/init.sql | 10 |
1 files changed, 10 insertions, 0 deletions
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) +); |