What problem does it solve?
PowerX CRUD Model standardizes GORM models to support multi-tenant data, consistent naming, and streamlined migrations, reducing drift between modules.
Core Features & Use Cases
- Embeds PowerModel/PowerUUIDModel and includes TenantID and DeletedAt to enable multi-tenant isolation and soft deletion.
- Enforces table naming returning schema-qualified names via TableName() and uses the PowerXSchema constant.
- Standardizes JSON fields with datatypes.JSON (JSONB) and provides status field with default value and indexing.
- Integrates with module migrations by providing a Migrate<Module>Models function and central migrate entry to run AutoMigrate.
Quick Start
Create a new GORM model that follows the embedded PowerModel/PowerUUIDModel, ensuring TenantID, DeletedAt, and Status fields, and register its migration with the module's AutoMigrate entry.