Migration
pelican.migration.Migration
dataclass
Migration(name, revision, up=None, down=None)
name
instance-attribute
name
revision
instance-attribute
revision
up
class-attribute
instance-attribute
up = None
down
class-attribute
instance-attribute
down = None
display_name
property
display_name
file_name
property
file_name
pelican.migration.MigrationRegistry
MigrationRegistry()
Source code in pelican/migration.py
37 38 | |
register_up
register_up(revision, name, func)
Source code in pelican/migration.py
40 41 42 43 44 45 46 47 48 49 50 51 52 | |
register_down
register_down(revision, name, func)
Source code in pelican/migration.py
54 55 56 57 58 59 60 61 62 63 64 65 66 | |
get_all
get_all()
Source code in pelican/migration.py
68 69 | |
get
get(revision)
Source code in pelican/migration.py
71 72 | |
clear
clear()
Source code in pelican/migration.py
74 75 | |
pelican.migration.up
up(func)
Decorator to register an 'up' migration.
Example
from pelican import migration
@migration.up
def upgrade() -> None:
...
Source code in pelican/migration.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
pelican.migration.down
down(func)
Decorator to register a 'down' migration.
Example
from pelican import migration
@migration.down
def downgrade() -> None:
...
Source code in pelican/migration.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
pelican.migration.MigrationError
Bases: Exception
Base exception for migration errors.
pelican.migration.DuplicateMigrationError
Bases: MigrationError
Raised when attempting to register duplicate up/down for same revision.