2023-09-07 15:34:15 +07:00
|
|
|
################## SHOULD I SPLIT FOLLOW INTO 2 TABLES ?? ################################
|
|
|
|
|
|
|
|
we can put following and follower as 1 table instead of 2 table
|
|
|
|
(follower and following) but it's gonna be have multiple where clause when
|
|
|
|
querying instead, we can use less where clause query if we split it into two
|
|
|
|
tables, but idk how big is the performance difference is, so for right now
|
|
|
|
i'm just put it on single table, if the query speed diff noticeable we can
|
|
|
|
just remigrate it later
|
|
|
|
|
|
|
|
REF: - https://www.percona.com/blog/how-expensive-is-a-where-clause-in-mysql/
|
|
|
|
- https://stackoverflow.com/questions/58829268/does-using-where-clause-with-a-select-statement-increase-or-decrease-performance
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################### IMPLEMENT POLYMORPHIC RELATIONS ################################
|
|
|
|
|
|
|
|
ok idk how to implement polymorphic (without ORM ofc) because Rails have
|
|
|
|
the thing the polymorphic thing but imma just create a table with 1 column
|
|
|
|
"type" just polymorphic relation table so when i query it imma use "where"
|
|
|
|
clause.
|
|
|
|
ex: select message where commented_id = ... and where comment_type = (stories, ratings, locations)
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####################### INDONESIA ADMINISTRATIVE DIVISION ################################
|
|
|
|
|
|
|
|
https://en.wikipedia.org/wiki/Provinces_of_Indonesia
|
|
|
|
|
|
|
|
|
2023-09-12 17:08:17 +07:00
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################### CUSTOM GIN VALIDATION ERR MESSAGE ##############################
|
|
|
|
|
|
|
|
make custom err message, and get all the type, the err message sucks now
|
|
|
|
https://github.com/gin-gonic/gin/issues/430 (using middleware)
|
|
|
|
tbh i'd raher use like a wrapper instead of middleware but we'll see
|
|
|
|
|
|
|
|
|
2023-09-13 21:42:39 +07:00
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
WITHOUT aUTHORIZATION ->
|
|
|
|
- AUTH
|
|
|
|
- GET LOCATIONS
|
|
|
|
- POST,PATCH,GET COMMENTS
|
|
|
|
- GET REVIEWS
|
|
|
|
- POST, REVIEWS ?
|
|
|
|
|
|
|
|
THE REST SHOUDL HAVE AUTHORIVAOZOIANITON
|
|
|
|
|
|
|
|
|
2023-09-17 16:30:01 +07:00
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
https://github.com/discourse/discourse
|
|
|
|
USE THIS FOR DISCSUSSSINON
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
OK FOR THE RATINGS IMMA USE THAT FLOW FIRST LIKE JOINING THE LOCAITONS AND REVIEWS
|
|
|
|
CALCULATE ALL THE RATINGS SHIT,
|
|
|
|
AFTER I FINISHED THE WHOLE THING IMMA TRY TO COMPARE IF EACH LOCATIONS HAVE user_ratings
|
|
|
|
user_counts etc etc
|
|
|
|
|
2023-09-23 15:23:31 +07:00
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
REWRITE COALESCE QUERY CAUSE IT'S SLOW
|
|
|
|
|
|
|
|
- https://stackoverflow.com/questions/6426436/postgresql-coalesce-performance-problem
|
|
|
|
- https://stackoverflow.com/questions/2287642/which-is-quicker-coalesce-or-isnull
|
|
|
|
|
2023-09-27 21:57:05 +07:00
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
USE THIS FOR NITFICOITON
|
|
|
|
|
|
|
|
https://docs.ntfy.sh/install/#docker
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
PAGINATION
|
|
|
|
|
|
|
|
http://andreyzavadskiy.com/2016/12/03/pagination-and-total-number-of-rows-from-one-select/
|
|
|
|
|
2023-10-03 14:55:42 +07:00
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|
|
|
|
PAGINATION
|
|
|
|
|
|
|
|
http://andreyzavadskiy.com/2016/12/03/pagination-and-total-number-of-rows-from-one-select/
|
|
|
|
https://medium.easyread.co/how-to-do-pagination-in-postgres-with-golang-in-4-common-ways-12365b9fb528?gi=a4683590d1d2
|
|
|
|
|
2023-09-07 15:34:15 +07:00
|
|
|
##########################################################################################
|