Skip to content

Commit 3b603c3

Browse files
committed
feat: Add configuration for steps prefix formats: Sequential or TimeStamp
1 parent 11da893 commit 3b603c3

File tree

6 files changed

+263
-111
lines changed

6 files changed

+263
-111
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Use the integrated help in the tool:
3535

3636
```powershell
3737
c:\>fdmigrator help
38-
fdmigrator v0.8.0 | (c)2024, [email protected]
38+
fdmigrator v0.9.0 | (c) 2024, [email protected]
3939
4040
Usage: fdmigrator <global options> <command> <arguments>
4141
@@ -45,29 +45,34 @@ Global Options:
4545
4646
Commands and Arguments:
4747
init Creates the working structure in <WorkDir>
48+
[--seq [fmt]] Selects Sequential format for step prefix, i.e. 00001-Create_Customer_Table.sql.
49+
Default fmt is "00000". Use a fmt compatible with Delphi FormatFloat.
50+
[--TS [fmt]] Selects TimeStamp format for step prefix, i.e. 20240616132951508-Create_Customer_Table.sql.
51+
Default fmt is "yyyymmddhhnnsszzz". Use a fmt compatible with Delphi FormatDateTime.
52+
--TS is the default option
4853
4954
steps Lists the steps pending application.
50-
-a Lists all steps
55+
[-a] Lists all steps
5156
5257
status Displays the last applied step.
5358
5459
new Creates a new migration step.
5560
-d Description. Required. Used to generate the step file name
56-
-t Template to use ("table" or "default")
61+
[-t] Template to use ("table" or "default")
5762
5863
defs Displays the connection names in use. Names starting with "!" are ignored.
5964
6065
up Applies all pending steps.
61-
-n <n> Applies only the next <n> steps.
66+
[-n <n>] Applies only the next <n> steps.
6267
6368
down Reverts the last applied step.
64-
-n <n> Reverts the next <n> steps. Pass * for all.
69+
[-n <n>] Reverts the next <n> steps. Pass * for all.
6570
6671
help Displays this help.
6772
6873
Usage Examples:
6974
70-
fdmigrator -w ./db steps list
75+
fdmigrator -w ./db steps
7176
Uses "./db" as the working directory and lists the pending migration steps.
7277
7378
fdmigrator -w ./db up -n 3

src/FDMigrator.Engine.Templates.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
interface
44

55
const
6+
DefaultConfigTT = '''
7+
{
8+
"status": ""
9+
}
10+
''';
11+
612
DefaultTT = '''
713
@__prelude__.
814

0 commit comments

Comments
 (0)