Skip to content

Commit ff038a7

Browse files
authored
Place categories (#125)
* Changes in the markers UI + schema for mainCategory * add many categories * Add mainCategory to details * Rename relations * fix join * add missing default * Disable rule * Fix possibly null * Fix type inference * Use drizzle queries for selecting data * Use translations for get one too * WithTranslations utility functions * Add namePlural and nameGender fields * Fix point formating causing data los when migrating * Merge migrations * Fix lint errors * chore: Auto-fix lint errors * Add point SRID again * Kind of fix selecting locations * Fix separator * Merge migrations
1 parent bbfd621 commit ff038a7

File tree

25 files changed

+1316
-299
lines changed

25 files changed

+1316
-299
lines changed

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
{
1616
"files": ["e2e-tests/**/*.{spec,test}.{mjs,cjs,js,ts,jsx,tsx}"],
1717
"extends": ["plugin:playwright/recommended"]
18+
},
19+
{
20+
"files": ["**/helpers/**/*.{mjs,cjs,js,ts,jsx,tsx}"],
21+
"rules": {
22+
"@typescript-eslint/no-explicit-any": "off"
23+
}
1824
}
1925
]
2026
}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ next-env.d.ts
4343
**/public/workbox-*.js
4444
**/public/sw.js
4545
**/public/fallback-*.js
46-
**/public/wse-*.js
46+
**/public/swe-*.js
4747
**/public/workbox-*.js.map
4848
**/public/sw.js.map
4949
**/public/fallback-*.js.map
50-
**/public/wse-*.js.map
50+
**/public/swe-*.js.map

drizzle/0006_orange_morbius.sql

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CREATE TABLE `placeCategory` (
2+
`id` serial AUTO_INCREMENT NOT NULL,
3+
`icon` tinytext NOT NULL,
4+
`color` tinytext NOT NULL,
5+
`name` tinytext NOT NULL,
6+
`namePlural` tinytext NOT NULL,
7+
`nameGender` enum('masculine','feminine'),
8+
CONSTRAINT `placeCategory_id` PRIMARY KEY(`id`)
9+
);
10+
--> statement-breakpoint
11+
CREATE TABLE `placeCategory_translation` (
12+
`id` serial AUTO_INCREMENT NOT NULL,
13+
`placeCategory_id` int NOT NULL,
14+
`locale` varchar(10) NOT NULL,
15+
`name` tinytext NOT NULL,
16+
`namePlural` tinytext NOT NULL,
17+
`nameGender` enum('masculine','feminine'),
18+
CONSTRAINT `placeCategory_translation_id` PRIMARY KEY(`id`)
19+
);
20+
--> statement-breakpoint
21+
CREATE TABLE `placeToPlaceCategory` (
22+
`placeId` int NOT NULL,
23+
`categoryId` int NOT NULL,
24+
CONSTRAINT `placeToPlaceCategory_categoryId_placeId` PRIMARY KEY(`categoryId`,`placeId`)
25+
);
26+
--> statement-breakpoint
27+
ALTER TABLE `place` ADD `mainCategoryId` int DEFAULT 1 NOT NULL;

0 commit comments

Comments
 (0)