All checks were successful
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m10s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 5m5s
Build and Release / Lint (push) Successful in 5m20s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 2m54s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h4m29s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 8m14s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 8m19s
Build and Release / Build Binary (linux/arm64) (push) Successful in 8m27s
Implements threaded comment system with support for authenticated users and verified guests. Adds email verification flow for guest commenters with token-based sessions and 6-digit codes. Includes reaction system (like/love/laugh/etc) for posts and comments. Adds comment count to blog posts, user profile blog tab, and email notifications for comment verification. Implements nested reply support with parent-child relationships.
28 lines
915 B
Go
28 lines
915 B
Go
// Copyright 2026 MarketAlly. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_26
|
|
|
|
import (
|
|
"code.gitcaddy.com/server/v3/modules/timeutil"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
// CreateBlogCommentTable adds the blog_comment table for comments and replies on blog posts.
|
|
func CreateBlogCommentTable(x *xorm.Engine) error {
|
|
type BlogComment struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
BlogPostID int64 `xorm:"INDEX NOT NULL"`
|
|
ParentID int64 `xorm:"INDEX NOT NULL DEFAULT 0"`
|
|
UserID int64 `xorm:"INDEX NOT NULL DEFAULT 0"`
|
|
GuestName string `xorm:"VARCHAR(100)"`
|
|
GuestEmail string `xorm:"VARCHAR(255)"`
|
|
Content string `xorm:"LONGTEXT NOT NULL"`
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
|
}
|
|
|
|
return x.Sync(new(BlogComment))
|
|
}
|