class

Altair::CLI::Generators::Migration

Inherits Altair::CLI::Generators::Base < Reference < Object

Constructors

new(name : String, columns : Array(Column))
Source

Instance methods

class_name

The migration's class name, e.g. CreatePosts.

Source
columns

The parsed columns the migration creates.

Source
exists?

Whether a file with this migration's name already exists.

Source
file_name

The migration file name, e.g. 20260802000001_create_posts.cr.

Source
generate

Writes the migration file and returns its path. Refuses to overwrite an existing migration so a regeneration never clobbers a run.

Source
name

The migration name argument, e.g. CreatePosts.

Source
path

The migration file path under db/migrations/.

Source
table

The table the migration creates, derived from a Create<Table> name, e.g. posts.

Source
version

The 14-digit version timestamp prefixing the file name.

Source