Last active
January 30, 2019 07:02
-
-
Save dsandip/885f6fac9f86667d7b81e9193817189c to your computer and use it in GitHub Desktop.
Custom functions: sample location tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create PostGIS extensions if they don't exist | |
CREATE EXTENSION IF NOT EXISTS postgis; | |
CREATE EXTENSION IF NOT EXISTS postgis_topology; | |
-- User location data | |
CREATE TABLE user_location ( | |
user_id INTEGER PRIMARY KEY, | |
location GEOGRAPHY(Point) | |
); | |
-- Landmark location data | |
CREATE TABLE landmark ( | |
id SERIAL PRIMARY KEY, | |
name TEXT, | |
type TEXT, | |
location GEOGRAPHY(Point) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment