erlang_migrate_source (erlang_migrate v0.3.4)
View Source迁移文件 source / Migration file source — 扫描 {version}_{title}.up.sql/.down.sql 对,按版本升序返回(标题支持 UTF-8)。
Summary
Types
-type migration() :: #{version := integer(), title := binary(), up_file := file:filename(), down_file := file:filename() | undefined}.
Functions
-spec read_sql(File :: file:filename(), Direction :: up | down) -> {ok, binary()} | {error, term()}.
-spec scan(Dir :: file:filename()) -> {ok, [migration()]} | {error, term()}.