Marten::DB::Management::SchemaEditor::Base
Base implementation of a database schema editor.
The database schema editor is used in the context of DB management in order to perform operation on models: create / delete models, add new fields, etc. It's heavily used by the migrations mechanism.
Constructors
Instance methods
Adds a column to a specific table.
Adds an index to a specific table.
Adds a unique constraint to a specific table.
Changes a column on a specific table.
Returns the database type for a specific built-in column implementation.
Note that this method is only used when handling column types of Marten built-in types as custom column
implementations must define a #db_type method.
Returns the database type suffix for a specific built-in column implementation.
Note that this method is only used when handling column types of Marten built-in types.
Returns a boolean indicating if the schema editor implementation supports rollbacking DDL statements.
Deletes the table corresponding to a specific table state.
Flushes all the tables associated with the passed table names.
Returns a prepared default value that can be inserted in a column definition.
Removes a column from a specific table.
Removes an index from a specific table.
Removes a unique constraint from a specific table.
Renames a specific column.
Syncs all models for the current database connection.
Every model whose table is not yet created will be created at the database level. This method should not be used on production databases (those are likely to be mutated using migrations), but this can be usefull when initializing a database for the first time in development or when running tests.