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).
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
version: "2"
|
|
sql:
|
|
- engine: "postgresql"
|
|
schema:
|
|
- "../db/sqlc_schemas.sql"
|
|
- "../organization/migrations/"
|
|
- "migrations/"
|
|
queries: "queries/"
|
|
gen:
|
|
go:
|
|
package: "fedwiki"
|
|
out: "."
|
|
sql_package: "database/sql"
|
|
emit_json_tags: true
|
|
emit_prepared_queries: false
|
|
emit_interface: true
|
|
emit_exact_table_names: false
|
|
emit_empty_slices: true
|
|
rename:
|
|
fedwiki_site: Site
|
|
fedwiki_sites: Site
|
|
identity_person: Person
|
|
identity_persons: Person
|
|
identity_user: User
|
|
identity_users: User
|
|
organization_organization: Organization
|
|
organization_organizations: Organization
|
|
organization_workspace: Workspace
|
|
organization_workspaces: Workspace
|
|
organization_role: Role
|
|
organization_roles: Role
|
|
organization_role_assignment: RoleAssignment
|
|
organization_role_assignments: RoleAssignment
|
|
organization_org_member: OrgMember
|
|
organization_org_members: OrgMember
|
|
overrides:
|
|
- db_type: "uuid"
|
|
go_type: "string"
|