class AzuCLI::Generate::Migration

Overview

Migration generator that creates CQL::Migration classes

Defined in:

azu_cli/generators/migration.cr

Constant Summary

OUTPUT_DIR = "./src/db/migrations"

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, attributes : Hash(String, String), timestamps : Bool = true) #

[View source]

Instance Method Detail

def ____collect_files(____files) #
Description copied from class Teeplate::FileTree

:nodoc:


[View source]
def __ecr0(____io) #

[View source]
def action_prefix : String #

[View source]
def action_prefix=(action_prefix : String) #

[View source]
def attributes : Hash(String, String) #

[View source]
def attributes=(attributes : Hash(String, String)) #

[View source]
def column_names : Array(String) #

Extract column names from migration name


[View source]
def crystal_type(attr_type : String) : String #

Get Crystal type for attribute


[View source]
def index_options(attr_type : String, field : String) : String #

Get index options


[View source]
def migration_class_name : String #

Get migration class name


[View source]
def migration_field_options(attr_type : String, field : String) : String #

Get migration field options


[View source]
def migration_field_type(attr_type : String) : String #

Get migration field type for CQL migrations


[View source]
def migration_filename : String #

Get migration filename


[View source]
def migration_type : String #

Detect migration type based on name pattern


[View source]
def name : String #

Migration configuration properties


[View source]
def name=(name : String) #

Migration configuration properties


[View source]
def should_add_index?(attr_type : String, field : String) : Bool #

Check if field should have an index


[View source]
def snake_case_name : String #

Convert name to snake_case for file naming


[View source]
def snake_case_name=(snake_case_name : String) #

[View source]
def table_name : String #

[View source]
def table_name=(table_name : String) #

[View source]
def table_name_for_template : String #

[View source]
def table_name_for_template=(table_name_for_template : String) #

[View source]
def target_table_name : String #

Extract table name from migration name for add/remove operations


[View source]
def timestamp : String #

[View source]
def timestamp=(timestamp : String) #

[View source]
def timestamps : Bool #

[View source]
def timestamps=(timestamps : Bool) #

[View source]