- build: somewhat polished dockerization setup - build: io/fs migrations with `golang-migrate` - feat: automatic init. admin account creation (.env creds) - feat(routers): combined user & token routers into single auth router - feat(routers): improved route layouts (`Routes`) - feat(middlewares): removed redundant `userCtx` middleware - fix(schema): note <-> note_versions relation (versioning) - feat(queries): removed redundant rollback functionality - feat(queries): combined duplicate version check & insertion/creation - tests: decreased redundancy by removing 'unnecessary' unit tests - refactor: hid internal packages behind `server/internal` - docs: notes & auth handler comments
49 lines
1.3 KiB
Go
49 lines
1.3 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.28.0
|
|
|
|
package data
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Note struct {
|
|
ID uuid.UUID `json:"id"`
|
|
UserID uuid.UUID `json:"user_id"`
|
|
CurrentVersion int32 `json:"current_version"`
|
|
LatestVersion int32 `json:"latest_version"`
|
|
CreatedAt *time.Time `json:"created_at"`
|
|
UpdatedAt *time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type NoteVersion struct {
|
|
ID uuid.UUID `json:"id"`
|
|
NoteID uuid.UUID `json:"note_id"`
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
VersionNumber int32 `json:"version_number"`
|
|
ContentHash string `json:"content_hash"`
|
|
CreatedAt *time.Time `json:"created_at"`
|
|
}
|
|
|
|
type RefreshToken struct {
|
|
ID uuid.UUID `json:"id"`
|
|
UserID uuid.UUID `json:"user_id"`
|
|
TokenHash string `json:"token_hash"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
CreatedAt *time.Time `json:"created_at"`
|
|
Revoked bool `json:"revoked"`
|
|
}
|
|
|
|
type User struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Username string `json:"username"`
|
|
PasswordHash string `json:"password_hash"`
|
|
IsAdmin bool `json:"is_admin"`
|
|
CreatedAt *time.Time `json:"created_at"`
|
|
UpdatedAt *time.Time `json:"updated_at"`
|
|
}
|