/** * Migration Helper System * * Automatically generates database migrations, RLS policies, and optimized indexes * from entity configurations including child entities and relationships. */ import type { EntityConfig } from './types'; export interface MigrationOptions { includeRLS?: boolean; includeIndexes?: boolean; includeChildEntities?: boolean; includeConstraints?: boolean; includeComments?: boolean; softDelete?: boolean; timestamps?: boolean; } export interface GeneratedMigration { up: string; down: string; filename: string; description: string; dependencies?: string[]; } export interface TableDefinition { tableName: string; columns: ColumnDefinition[]; indexes: IndexDefinition[]; constraints: ConstraintDefinition[]; rlsPolicies: RLSPolicyDefinition[]; } export interface ColumnDefinition { name: string; type: string; nullable: boolean; defaultValue?: string; primaryKey?: boolean; unique?: boolean; comment?: string; } export interface IndexDefinition { name: string; columns: string[]; unique?: boolean; partial?: string; method?: 'btree' | 'gin' | 'gist' | 'hash'; comment?: string; } export interface ConstraintDefinition { name: string; type: 'PRIMARY KEY' | 'FOREIGN KEY' | 'UNIQUE' | 'CHECK'; definition: string; comment?: string; } export interface RLSPolicyDefinition { name: string; action: 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' | 'ALL'; role?: string; using?: string; withCheck?: string; comment?: string; } /** * Generate complete migration for an entity */ export declare function generateEntityMigration(entityConfig: EntityConfig, options?: MigrationOptions): GeneratedMigration; /** * Generate migration boilerplate for a new entity */ export declare function generateMigrationBoilerplate(entityName: string): string; /** * Validate entity configuration for migration generation */ export declare function validateEntityForMigration(entityConfig: EntityConfig): { valid: boolean; errors: string[]; warnings: string[]; }; //# sourceMappingURL=migration-helper.d.ts.map