Drop redundant schema prefixes from all sqlc-generated Go types. Since each module generates into its own package, the package already provides the namespace — billing.Account is unambiguous without billing.BillingAccount. Changes: - Add rename: blocks to all 6 sqlc.yaml files mapping schema-prefixed names to clean idiomatic names (e.g. BillingBillingAccount → Account, IdentityPerson → Person, OrganizationOrganization → Organization) - Rename billing.billing_accounts → billing.accounts (table name repeated the schema; the schema already provides that context) - Rename integration.integration_outbox → integration.outbox (same reason) - Regenerate all sqlc output across billing, identity, organization, entitlements, stripe, and fedwiki modules - Update all calling code (server, workflows, provisioning, tests) to use the new names - Add internal/db/sqlc_schemas.sql — sqlc-only schema declarations so every module can resolve schema-qualified names without including the full db migrations - Update docs/database-management.md with the naming convention and standard sqlc.yaml template Convention going forward: table names must not repeat the schema name; generated types carry no schema prefix; the Go package provides the namespace (like http.Request, not http.HttpRequest).
79 lines
2.4 KiB
Go
79 lines
2.4 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.29.0
|
|
|
|
package fedwiki
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type OrgMember struct {
|
|
OrgMemberID string `json:"org_member_id"`
|
|
OrgID string `json:"org_id"`
|
|
PersonID string `json:"person_id"`
|
|
RoleID string `json:"role_id"`
|
|
Status string `json:"status"`
|
|
JoinedAt time.Time `json:"joined_at"`
|
|
RemovedAt sql.NullTime `json:"removed_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Organization struct {
|
|
OrgID string `json:"org_id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
OrgType string `json:"org_type"`
|
|
OwnerPersonID string `json:"owner_person_id"`
|
|
Status string `json:"status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Role struct {
|
|
RoleID string `json:"role_id"`
|
|
OrgID uuid.NullUUID `json:"org_id"`
|
|
RoleName string `json:"role_name"`
|
|
DisplayName string `json:"display_name"`
|
|
Description sql.NullString `json:"description"`
|
|
IsSystem bool `json:"is_system"`
|
|
Permissions []string `json:"permissions"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type RoleAssignment struct {
|
|
AssignmentID string `json:"assignment_id"`
|
|
RoleID string `json:"role_id"`
|
|
PersonID string `json:"person_id"`
|
|
OrgID string `json:"org_id"`
|
|
ScopeType string `json:"scope_type"`
|
|
ScopeID string `json:"scope_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Site struct {
|
|
SiteID string `json:"site_id"`
|
|
WorkspaceID string `json:"workspace_id"`
|
|
Domain string `json:"domain"`
|
|
IsCustomDomain bool `json:"is_custom_domain"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Workspace struct {
|
|
WorkspaceID string `json:"workspace_id"`
|
|
OrgID string `json:"org_id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
Description sql.NullString `json:"description"`
|
|
Status string `json:"status"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|