-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
Goal
My goal is to unify all database actions pgroll is executing. Example actions include dropping columns, renaming columns, creating and dropping triggers, creating constraints, etc.
We can define a list of these actions in a migration phase and run them sequentially. The following example is a Complete
phase of an imaginary migration:
func Complete(ctx context.Context) []DBAction {
return []DBAction{
NewDropColumnAction(conn, tableName, columnName),
NewRenameColumnAction(conn, tableName, newName, oldName),
NewDropColumnAction(conn, tableName, CNeedsBackfill),
NewDropTriggerAction(conn, triggerName),
}
}
TODO
- define new
DBAction
interface IntroduceDBAction
interface and refactoring of column dropping #709 - drop columns Introduce
DBAction
interface and refactoring of column dropping #709 - rename column Implement rename column actions as
DBAction
#746 - rename duplicated column
- create index
- create unique index Implement creating a unique index concurrently as a
DBAction
#747 - create constraints
- rename constraints Add rename constraint action as
DBAction
#752 - create trigger Implement creating triggers as
DBAction
#749 - drop function Implement dropping functions as
DBAction
#750 - Add support for comments as
DBAction
#757 - create table Implement create table as a
DBAction
#764 - drop table Implement dropping tables as
DBAction
#794 - drop index Implement dropping indexes as
DBAction
#793 - change the interface of migration phases to return a list of DBActions
Metadata
Metadata
Assignees
Labels
No labels