class

Marten::DB::Management::Column::Base

Inherits Marten::DB::CanFormatStringsOrSymbols / Reference / Object

Abstract base migration column implementation.

Constructors

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

Instance methods

==(other : self)

Returns true if the other column corresponds to the same column configuration.

Source
clone

Returns a copy of the column.

Source
default
Source
index?

Returns true if an index should be created at the database level for the column.

Source
name
Source
name=(name : ::String)
Source
null?

Returns a boolean indicating whether the column can be null or not.

Source
primary_key=(primary_key : ::Bool)
Source
primary_key?

Returns a boolean indicating whether the column is a primary 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
type

Returns the column type identifier.

Source
unique?

Returns a boolean indicating whether the column value should be unique throughout the associated table.

Source