class
AzuCLI::Generate::Migration
- AzuCLI::Generate::Migration
- Teeplate::FileTree
- Reference
- Object
Overview
Migration generator that creates CQL::Migration classes
Defined in:
azu_cli/generators/migration.crConstant Summary
-
OUTPUT_DIR =
"./src/db/migrations"
Constructors
Instance Method Summary
-
#____collect_files(____files)
:nodoc:
- #__ecr0(____io)
- #action_prefix : String
- #action_prefix=(action_prefix : String)
- #attributes : Hash(String, String)
- #attributes=(attributes : Hash(String, String))
-
#column_names : Array(String)
Extract column names from migration name
-
#crystal_type(attr_type : String) : String
Get Crystal type for attribute
-
#index_options(attr_type : String, field : String) : String
Get index options
-
#migration_class_name : String
Get migration class name
-
#migration_field_options(attr_type : String, field : String) : String
Get migration field options
-
#migration_field_type(attr_type : String) : String
Get migration field type for CQL migrations
-
#migration_filename : String
Get migration filename
-
#migration_type : String
Detect migration type based on name pattern
-
#name : String
Migration configuration properties
-
#name=(name : String)
Migration configuration properties
-
#should_add_index?(attr_type : String, field : String) : Bool
Check if field should have an index
-
#snake_case_name : String
Convert name to snake_case for file naming
- #snake_case_name=(snake_case_name : String)
- #table_name : String
- #table_name=(table_name : String)
- #table_name_for_template : String
- #table_name_for_template=(table_name_for_template : String)
-
#target_table_name : String
Extract table name from migration name for add/remove operations
- #timestamp : String
- #timestamp=(timestamp : String)
- #timestamps : Bool
- #timestamps=(timestamps : Bool)
Constructor Detail
def self.new(name : String, attributes : Hash(String, String), timestamps : Bool = true)
#
Instance Method Detail
def migration_field_options(attr_type : String, field : String) : String
#
Get migration field options
def should_add_index?(attr_type : String, field : String) : Bool
#
Check if field should have an index