@blitzjs/installer
Version:
Package installation for the Blitz CLI
21 lines (20 loc) • 688 B
TypeScript
import { Field } from '@mrleebo/prisma-ast';
/**
* Adds a field to a model in your schema.prisma data model.
*
* @param source - schema.prisma source file contents
* @param modelName - name of the model to add a field to
* @param fieldProps - the field to add
* @returns The modified schema.prisma source
* @example Usage
* ```
* addPrismaField(source, "Project", {
type: "field",
name: "name",
fieldType: "String",
optional: false,
attributes: [{type: "attribute", kind: "field", name: "unique"}],
})
* ```
*/
export declare function addPrismaField(source: string, modelName: string, fieldProps: Field): Promise<string>;