Last active
March 7, 2021 08:04
-
-
Save tetrashine/a82d993d685cef24998c5d2e10d444df to your computer and use it in GitHub Desktop.
map-dashboard-postgresql.sql
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 TABLE map.assets ( | |
| id SERIAL primary key, | |
| name VARCHAR(50) | |
| ); | |
| CREATE TABLE map.assets_location ( | |
| id SERIAL primary key, | |
| asset_id INTEGER references assets, | |
| last_update TIMESTAMP, | |
| geom geometry(Point, 4326) | |
| ); | |
| insert into map.assets(name) | |
| values ('vehicle1'); | |
| insert into map.assets_location(asset_id, last_update, geom) | |
| values (1, NOW(), GeomFromEWKT('SRID=4326;POINT(103.860579 1.284752)')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment