class Marten::DB::Management::ProjectState

Overview

Represents the state of the whole DB schema of the project at a specific step in a migration plan.

Defined in:

marten/db/management/project_state.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(tables = [] of TableState) #

[View source]

Class Method Detail

def self.from_apps(apps : Array(Apps::Config)) #

Initialize a project state from all the current tables of the project applications.


[View source]

Instance Method Detail

def add_table(table : TableState) : Nil #

Adds a table state to the current project state.


[View source]
def clone #

Returns a clone of the current project state.


[View source]
def delete_table(app_label : String, name : String) : Nil #

Deletes a table state from the current project state.


[View source]
def get_table(app_label : String, name : String) : TableState #

Returns the table state corresponding to the passed app label and table name.


[View source]
def get_table(id : String) : TableState #

Returns the table state corresponding to the passed table ID.


[View source]
def rename_table(app_label : String, old_name : String, new_name : String) : Nil #

Renames a specific a table state.


[View source]
def tables : Hash(String, Marten::DB::Management::TableState) #

[View source]