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.registry.MigrationRegistry
MigrationRegistry()
Source code in pelican/registry.py
9 10 | |
register_up
register_up(revision, name, func)
Source code in pelican/registry.py
12 13 14 15 16 17 18 19 20 21 22 23 24 | |
register_down
register_down(revision, name, func)
Source code in pelican/registry.py
26 27 28 29 30 31 32 33 34 35 36 37 38 | |
get_all
get_all()
Source code in pelican/registry.py
40 41 | |
get
get(revision)
Source code in pelican/registry.py
43 44 | |
clear
clear()
Source code in pelican/registry.py
46 47 | |
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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
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
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
pelican.migration.MigrationError
Bases: Exception
pelican.migration.DuplicateMigrationError
Bases: MigrationError