Skip to content

Instantly share code, notes, and snippets.

@tetrashine
Last active March 7, 2021 08:04
Show Gist options
  • Select an option

  • Save tetrashine/a82d993d685cef24998c5d2e10d444df to your computer and use it in GitHub Desktop.

Select an option

Save tetrashine/a82d993d685cef24998c5d2e10d444df to your computer and use it in GitHub Desktop.
map-dashboard-postgresql.sql
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