class Marten::DB::Management::Column::Reference

Included Modules

Defined in:

marten/db/management/column.cr
marten/db/management/column/reference.cr

Constructors

Instance Method Summary

Instance methods inherited from class Marten::DB::Management::Column::Base

==(other : self) ==, clone clone, default : Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | Time | Nil default, index? : Bool index?, name : String name, name=(name : ::String) name=, null? : Bool null?, primary_key=(primary_key : ::Bool) primary_key=, primary_key? : Bool primary_key?, same_config?(other : Base) same_config?, serialize_args : ::String serialize_args, sql_quoted_default_value(connection : Connection::Base) : ::String | Nil sql_quoted_default_value, sql_type(connection : Connection::Base) : ::String sql_type, sql_type_suffix(connection : Connection::Base) : ::String | Nil sql_type_suffix, type : ::String type, unique? : Bool unique?

Constructor methods inherited from class Marten::DB::Management::Column::Base

new(name : ::String, primary_key : ::Bool = false, null : ::Bool = false, unique : ::Bool = false, index : ::Bool = false, default : ::DB::Any | Nil = nil) new

Instance methods inherited from module Marten::DB::CanFormatStringsOrSymbols

format_string_or_symbol(value : String) format_string_or_symbol

Constructor Detail

def self.new(name : ::String, to_table : ::String | Symbol, to_column : ::String | Symbol, primary_key = false, foreign_key : ::Bool = true, null = false, unique = false, index = true) #

[View source]

Instance Method Detail

def clone #
Description copied from class Marten::DB::Management::Column::Base

Returns a copy of the column.


[View source]
def foreign_key? : Bool #

Returns a boolean indicating whether the column is a foreign key.


[View source]
def same_config?(other : Base) #
Description copied from class Marten::DB::Management::Column::Base

Returns true if the other column (which can have a different name) corresponds to the same configuration.


[View source]
def serialize_args : ::String #
Description copied from class Marten::DB::Management::Column::Base

Returns a serialized version of the column arguments to be used when generating migrations.

The returned string will be used in the context of add_column / column statements in generated migrations.


[View source]
def sql_quoted_default_value(connection : Connection::Base) : ::String | Nil #
Description copied from class Marten::DB::Management::Column::Base

Returns the literal quoted value of the default value for a specific database connection.


[View source]
def sql_type(connection : Connection::Base) : ::String #
Description copied from class Marten::DB::Management::Column::Base

Returns the raw type of the column to use for the column at hand and a specific database connection.


[View source]
def sql_type_suffix(connection : Connection::Base) : ::String | Nil #
Description copied from class Marten::DB::Management::Column::Base

Returns the raw type suffix of the column to use for the column at hand and a specific database connection.


[View source]
def to_column : String #

[View source]
def to_table : String #

[View source]