UNPKG

@megaorm/cli

Version:

This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).

34 lines (28 loc) 744 B
import { MegaGenerator } from '@megaorm/gen'; /** * This is a base generator template for managing database tables. * * @extends `MegaGenerator` */ class [className] extends MegaGenerator { /** * Creates a generator instance. */ constructor() { super(); // The table name associated with this generator. this.set.table('[tableName]'); } /** * Creates the `[tableName]` table. */ public create(): Promise<void> { return this.schema( this.primaryKey(), // Primary key column this.createdAt(), // CreatedAt column this.updatedAt() // UpdatedAt column // Add more columns here... ) } } export default new [className]();