Add unified posts database groundwork (#2)

Adds self-referencing post and post-vote tables, generated schema models, and an idempotent snapshot migration that preserves the legacy tables during the staged application cutover.

Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #2.
This commit is contained in:
2026-08-27 07:05:24 +00:00
committed by codegirl007
parent 418ef93da5
commit c5ef15ae1f
4 changed files with 335 additions and 0 deletions
+20
View File
@@ -5,6 +5,7 @@
package sqlc
import (
"database/sql"
"time"
)
@@ -16,6 +17,25 @@ type Answer struct {
UpdatedAt string
}
type Post struct {
ID string
ParentID sql.NullString
AuthorID string
Title string
Body string
City string
PostDate string
Hidden int32
CreatedAt string
UpdatedAt string
}
type PostVote struct {
UserID string
PostID string
Value int32
}
type Question struct {
ID string
AuthorID string