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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user