/** * The set of column types understood by the schema grammars. Each maps to a * `type` method in the grammar, so adding a new type means adding a case * here plus the corresponding grammar method(s). */ export type ColumnType = 'char' | 'string' | 'text' | 'mediumText' | 'longText' | 'integer' | 'unsignedInteger' | 'bigInteger' | 'unsignedBigInteger' | 'smallInteger' | 'tinyInteger' | 'increments' | 'bigIncrements' | 'boolean' | 'float' | 'double' | 'decimal' | 'date' | 'dateTime' | 'time' | 'timestamp' | 'json' | 'jsonb' | 'uuid' | 'integerArray'; /** * A raw, unescaped SQL fragment. Use it when a modifier value must be emitted * verbatim (e.g. a function call in a DEFAULT clause): * * table.timestamp('createdAt').default(new SchemaExpression('NOW()')) */ export declare class SchemaExpression { readonly value: string; constructor(value: string); } /** * Fluent description of a single table column. Column methods on the Blueprint * (`table.string(...)`, `table.integer(...)`, …) create one of these and return * it, so the caller can chain modifiers exactly like Laravel: * * table.string('email', 150).nullable().unique() * table.integer('status').default(1) * table.timestamp('createdAt').useCurrent() */ export declare class ColumnDefinition { name: string; type: ColumnType; length?: number; total?: number; places?: number; isNullable: boolean; hasDefault: boolean; defaultValue: any; isUnsigned: boolean; isAutoIncrement: boolean; isPrimary: boolean; isUnique: boolean; isIndex: boolean; useCurrentTimestamp: boolean; useCurrentOnUpdateTimestamp: boolean; columnComment?: string; afterColumn?: string; isChange: boolean; constructor(name: string, type: ColumnType, attributes?: Partial); /** Marks the column as nullable (Laravel columns are NOT NULL by default). */ nullable(value?: boolean): this; /** Explicitly marks the column NOT NULL. */ notNullable(): this; /** Sets the column DEFAULT value. Pass a SchemaExpression for raw SQL. */ default(value: any): this; /** Marks an integer column UNSIGNED (no-op on engines without unsigned types). */ unsigned(): this; /** Marks the column auto-incrementing (implies a primary key). */ autoIncrement(): this; /** Adds this column to the table primary key. */ primary(): this; /** Adds a single-column UNIQUE constraint. */ unique(): this; /** Adds a single-column index. */ index(): this; /** Uses CURRENT_TIMESTAMP as the column default. */ useCurrent(): this; /** Uses CURRENT_TIMESTAMP when the row is updated (MySQL ON UPDATE). */ useCurrentOnUpdate(): this; /** Attaches a column comment (emitted by engines that support it). */ comment(comment: string): this; /** Positions the column after another one (MySQL ADD COLUMN … AFTER). */ after(column: string): this; /** Marks the column as a modification of an existing one (Schema.table change). */ change(): this; }