nestjs rewrite

This commit is contained in:
popovspiridon99
2025-08-01 11:08:33 +09:00
parent 1f9a3a8e03
commit 145827ab6d
28 changed files with 1220 additions and 623 deletions

35
ems/DATABASE.md Normal file
View File

@ -0,0 +1,35 @@
Make sure to use PostGIS
Create tables first:
```sql
CREATE TABLE IF NOT EXISTS bounds (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
entity_id INT NOT NULL,
entity_type TEXT NOT NULL,
geometry GEOMETRY(MULTIPOLYGON, 3857) NOT NULL,
UNIQUE (entity_id, entity_type)
);
```
```sql
CREATE TABLE IF NOT EXISTS lines (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
object_id UUID NOT NULL,
geometry GEOMETRY(LINESTRING, 3857) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(),
schema TEXT NOT NULL
);
```
```sql
CREATE TABLE IF NOT EXISTS shapes (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
object_id UUID NOT NULL,
geometry GEOMETRY(POLYGON, 3857) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(),
schema TEXT NOT NULL
);
```