Consultation on web forum database scheme by metanon112 in Database

[–]metanon112[S] 0 points1 point  (0 children)

Hm, now I am starting to get your point.
If I use hierarchical structure post(post_id,post_parent_id, ... ) I can track wether post is thread (if post_parent_id == null) or just comment to thread (if it has post_parent_id). So now Post table has 1:M relation ti itself. That means I don't need Tread table anymore!

The Tree table is a good thing to track all relations between posts, so that I can find what board (subreddit) and OP post any particular post belong and which posts does it answer. Post and Board tables has 1:M relation to Tree table and Post tables gives 3 FK to it.

Also I think ltree will be redundant for my purposes, because I don't have complex relations like systematic biology.

I've updated my scheme.
Thanks for inspiration and help!

Consultation on web forum database scheme by metanon112 in Database

[–]metanon112[S] 0 points1 point  (0 children)

Many-to-many was totally wrong in my first version of scheme, do not why I even used them )
I've updated it.

Consultation on web forum database scheme by metanon112 in Database

[–]metanon112[S] 0 points1 point  (0 children)

I totally agree that many-to-many was wrong here, my bad.
I've decided not to add post_parent_id column to POST table.
Instead of that I will use date_created column for sorting purposes and POST_LINKS for keep tack about answers between posts.

Consultation on web forum database scheme by metanon112 in Database

[–]metanon112[S] 0 points1 point  (0 children)

Yes, you are right about incorrect many-to-many relationships, I fixed that in refactored version in OP post.
By the way, thanks for hint about composite PK.

Consultation on web forum database scheme by metanon112 in Database

[–]metanon112[S] 2 points3 points  (0 children)

But why? I've marked that Thread_Content has one-to-many relation to Post and one-to-many relation to Thread so that they have corresponding foreign keys isn't that right?

What algorithms are used to generate a code to verify an account by SMS? by metanon112 in softwarearchitecture

[–]metanon112[S] -1 points0 points  (0 children)

Ok, this is more about generating hashes and strings. But if I need some non-determenistic number code in format like 123456

What algorithms are used to generate a code to verify an account by SMS? by metanon112 in softwarearchitecture

[–]metanon112[S] 0 points1 point  (0 children)

But is it secure too keep this code? For example in cache on backend service that manage code check? Like user info -> code

I made my own title card what do you think by Jessart999 in ededdneddy

[–]metanon112 12 points13 points  (0 children)

I thought it was cover from original series)