Skip to content

Commit 91a5c97

Browse files
committed
chore: support custom timestamp for database migration script
1 parent a93006d commit 91a5c97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/database_migration.exs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,12 @@ defmodule DatabaseMigration do
13691369
pwd = ".local/db"
13701370
File.mkdir_p!(pwd)
13711371

1372-
timestamp = Calendar.strftime(DateTime.utc_now(), "%Y-%m-%d-%H-%M-%S")
1372+
timestamp =
1373+
case System.argv() do
1374+
[timestamp | _] -> timestamp
1375+
[] -> Calendar.strftime(DateTime.utc_now(), "%Y-%m-%d-%H-%M-%S")
1376+
end
1377+
13731378
input_path = Path.join(pwd, "v1-data-#{timestamp}.sql")
13741379
output_path = Path.join(pwd, "v2-data-#{timestamp}.sql")
13751380

0 commit comments

Comments
 (0)