ManagementSystem/modules/scylladb/models.go

101 lines
1.8 KiB
Go

package scylladb
import (
"github.com/scylladb/gocqlx/v2/table"
)
var (
Users = table.New(table.Metadata{
Name: "users",
Columns: []string{
"id",
"username",
"account_name",
"account_name_lc",
"email",
"password",
"description",
"latitude",
"longitude",
"xp_level",
"xp_points",
"followers_count",
"following_count",
"account_status",
"avatar_url",
"public_keys",
"created_at",
"updated_at"},
PartKey: []string{"id"},
})
WebSocketSessions = table.New(table.Metadata{
Name: "ws_sessions",
Columns: []string{
"id",
"user_id",
"user_agent",
"ip",
"last_used",
"created_at"},
PartKey: []string{"id"},
})
UserSignUpProcess = table.New(table.Metadata{
Name: "user_sign_up_process",
Columns: []string{
"x_token",
"email",
"user_agent",
"ip",
"email_verify_code",
"email_verified",
"last_email_resend",
"created_at",
"expires_at",
},
PartKey: []string{"x_token"},
})
Chats = table.New(table.Metadata{
Name: "chats",
Columns: []string{
"user_first_id",
"user_second_id",
"sync_count",
"last_messages",
"blocked_state",
"created_at",
},
PartKey: []string{"user_first_id", "user_second_id"},
})
UserRelationship = table.New(table.Metadata{
Name: "user_relationship",
Columns: []string{
"user_first_id",
"user_second_id",
"user_first_following_state",
"user_second_following_state",
"blocked_state",
"created_at",
"updated_at",
},
PartKey: []string{"user_first_id", "user_second_id"},
})
UserPrivacySettings = table.New(table.Metadata{
Name: "user_privacy_settings",
Columns: []string{
"user_id",
"username",
"avatar",
"description",
"location",
"created_at",
"updated_at",
},
PartKey: []string{"user_id"},
})
)