Skip to content

Commit

Permalink
Follow example structure with version directories (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
define-null authored Oct 24, 2022
1 parent 257cd08 commit c9c74a3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/electric/migration_utils.ex
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
defmodule Electric.Migration.Utils do
@type vsn() :: String.t()

@spec available_migrations() :: [vsn()]
def available_migrations() do
migration_path = get_migration_dir()

Enum.map(
Path.wildcard(Path.join(migration_path, "*.sql")),
&Path.basename(&1, ".sql")
)
end

@spec read_migration_file(vsn()) :: {:ok, binary} | {:error, term}
def read_migration_file(vsn) do
file = get_migration_path(vsn)
Expand All @@ -27,7 +17,7 @@ defmodule Electric.Migration.Utils do
@spec get_migration_path(vsn()) :: binary
def get_migration_path(vsn) do
migration_path = get_migration_dir()
Path.join(migration_path, vsn <> ".sql")
Path.join(migration_path, vsn <> "/postgres.sql")
end

defp get_migration_dir() do
Expand Down

0 comments on commit c9c74a3

Please sign in to comment.