migration
Migration classes for creating and running database migrations.
Ddl
Represents a DDL statement with optional constraints.
Source code in src/embar/migration.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
__init__(name, ddl, constraints=None)
Create a new Ddl instance.
Source code in src/embar/migration.py
21 22 23 24 25 26 27 | |
Migration
Represents a migration that can be run against a database.
Source code in src/embar/migration.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
merged
property
Get all DDL statements merged into a single string.
__await__()
Run the migration asynchronously.
Source code in src/embar/migration.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
__init__(ddls, db)
Create a new Migration instance.
Source code in src/embar/migration.py
54 55 56 57 58 59 | |
run()
Run the migration synchronously.
Returns self so that await db.migrate([...]).run() works for async.
For sync callers, the return value can be ignored.
Source code in src/embar/migration.py
96 97 98 99 100 101 102 103 104 105 106 107 108 | |
MigrationDefs
Holds table and enum definitions for migrations.
Source code in src/embar/migration.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
__init__(tables, enums=None)
Create a new MigrationDefs instance.
Source code in src/embar/migration.py
38 39 40 41 42 43 | |