forked from mdg/pygrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DESIGN
57 lines (44 loc) · 1.22 KB
/
DESIGN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
= pygration =
Step
* An individual change to the DB.
* Overridden by users
* Includes hooks for each phase
* Implemented in pygration.step
= pygration.config =
select()
* Selects a config file from a set based on options
load()
* Loads a Config for a given file
Config
* Object that holds db & environment configuration
= pygration.history =
load()
* loads a History object from the DB
History
* reports current history
* writes new history back to the DB when changes are made
= pygration.migration =
Migration
* A collection of Steps that constitute a logical
change set and can be referenced by a version number.
* Defined by a single python file containing all the Steps.
* Each Phase is run for each step in the Migration before moving
on to the next Phase.
MigrationSet
* finds migrations at the given path
* loads Steps for a given VersionSet from the filesystem
find()
* finds available VersionSets from the filesystem
= pygration.migrator =
Migrator
* execute_sql()
* execute_file()
* a special migrator is used for each phase
= pygration.model =
Model code will eventually be added to allow structural changes rather than
writing direct SQL.
AddMigrator
DropMigrator
CommitDropMigrator
RollbackAddMigrator
RollbackDropMigrator