class

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

Inherits Marten::DB::Management::Column::IsBuiltInColumn / Marten::DB::Management::Column::Base / Marten::DB::CanFormatStringsOrSymbols / Reference / Object

Constructors

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

Instance methods

clone

Returns a copy of the column.

Source
foreign_key?

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

Source
same_config?(other : Base)

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

Source
serialize_args

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.

Source
sql_quoted_default_value(connection : Connection::Base) : ::String | Nil

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

Source
sql_type(connection : Connection::Base) : ::String

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

Source
sql_type_suffix(connection : Connection::Base) : ::String | Nil

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

Source
to_column
Source
to_table
Source