class

AzuCLI::Generate::Migration

Inherits Teeplate::FileTree < Reference < Object

Migration generator that creates CQL::Migration classes

Constants

OUTPUT_DIR = "./db/migrations"

Constructors

new(name : String, attributes : Hash(String, String), timestamps : Bool = true, id_type : String = "Int64")
Source

Instance methods

____collect_files(____files)

:nodoc:

Source
__ecr0(____io)
Source
action_prefix
Source
action_prefix=(action_prefix : String)
Source
attributes
Source
attributes=(attributes : Hash(String, String))
Source
column_names

Extract column names from migration name

Source
crystal_type(attr_type : String) : String

Get Crystal type for attribute

Source
id_type
Source
id_type=(id_type : String)
Source
index_options(attr_type : String, field : String) : String

Get index options

Source
migration_class_name

Get migration class name

Source
migration_field_options(attr_type : String, field : String) : String

Get migration field options

Source
migration_field_type(attr_type : String) : String

Get migration field type for CQL migrations

Source
migration_filename

Get migration filename

Source
migration_type

Detect migration type based on name pattern

Source
name

Migration configuration properties

Source
name=(name : String)

Migration configuration properties

Source
should_add_index?(attr_type : String, field : String) : Bool

Check if field should have an index

Source
snake_case_name

Convert name to snake_case for file naming

Source
snake_case_name=(snake_case_name : String)
Source
table_name
Source
table_name=(table_name : String)
Source
table_name_for_template
Source
table_name_for_template=(table_name_for_template : String)
Source
target_table_name

Extract table name from migration name for add/remove operations

Source
timestamp
Source
timestamp=(timestamp : String)
Source
timestamps
Source
timestamps=(timestamps : Bool)
Source