Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from electric-sql/migration-sync
Browse files Browse the repository at this point in the history
Adding generation of postgresql files
  • Loading branch information
paulharter authored Oct 10, 2022
2 parents 3a09d7b + 73a35f1 commit 3e7c74f
Show file tree
Hide file tree
Showing 17 changed files with 1,625 additions and 648 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ And run it:

This creates a binary at `./dist/electric` and needs to be run on the OS you are targetting.
See also https://github.com/bake-bake-bake/bakeware#static-compiling-openssl-into-erlang-distribution


## Migration commands


15 changes: 12 additions & 3 deletions lib/electric/commands/migrations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,24 @@ defmodule Electric.Commands.Migrations do
end

def init(%{args: _args, flags: _flags, options: options, unknown: _unknown}) do
Electric.Migrations.init_migrations(options)
case Electric.Migrations.init_migrations(options) do
{:ok, message} -> {:success, message}
{:error, message} -> {:error, message}
end
end

def new(%{args: args, flags: _flags, options: options, unknown: _unknown}) do
Electric.Migrations.new_migration(args.migration_name, options)
case Electric.Migrations.new_migration(args.migration_name, options) do
{:ok, message} -> {:success, message}
{:error, message} -> {:error, message}
end
end

def build(%{args: _args, flags: flags, options: options, unknown: _unknown}) do
Electric.Migrations.build_migrations(flags, options)
case Electric.Migrations.build_migrations(flags, options) do
{:ok, message} -> {:success, message}
{:error, message} -> {:error, message}
end
end

def sync(%{args: %{database_id: database_id}, options: %{dir: dir}}) do
Expand Down
Loading

0 comments on commit 3e7c74f

Please sign in to comment.