diff --git a/lib/ketbin/api/user.ex b/lib/ketbin/api/user.ex new file mode 100644 index 0000000..8f4f9bc --- /dev/null +++ b/lib/ketbin/api/user.ex @@ -0,0 +1,3 @@ +defmodule Ketbin.Api.User do + +end \ No newline at end of file diff --git a/lib/ketbin/arch.ex b/lib/ketbin/arch.ex new file mode 100644 index 0000000..df38547 --- /dev/null +++ b/lib/ketbin/arch.ex @@ -0,0 +1,18 @@ +defmodule Ketbin.Schema do + @moduledoc """ + Ketbin keeps the contexts that define your schemas + """ +end + + +defmodule Ketbin.Crud do + @moduledoc """ + Ketbin keeps the contexts that define your CRUD functions + """ +end + +defmodule Ketbin.Api do + @moduledoc """ + Ketbin keeps the contexts that define your business logic. + """ +end \ No newline at end of file diff --git a/lib/ketbin/crud/user.ex b/lib/ketbin/crud/user.ex new file mode 100644 index 0000000..fc89cf4 --- /dev/null +++ b/lib/ketbin/crud/user.ex @@ -0,0 +1,3 @@ +defmodule Ketbin.Crud.User do + +end \ No newline at end of file diff --git a/lib/ketbin/schema/user.ex b/lib/ketbin/schema/user.ex new file mode 100644 index 0000000..4e0fc8e --- /dev/null +++ b/lib/ketbin/schema/user.ex @@ -0,0 +1,17 @@ +defmodule Ketbin.Schema.User do + use Ecto.Schema + import Ecto.Changeset + + schema "users" do + field :firebase_id, :string + + timestamps() + end + + @doc false + def changeset(user, attrs) do + user + |> cast(attrs, [:firebase_id]) + |> validate_required([:firebase_id]) + end +end diff --git a/priv/repo/migrations/20210809085801_create_users.exs b/priv/repo/migrations/20210809085801_create_users.exs new file mode 100644 index 0000000..b2162b8 --- /dev/null +++ b/priv/repo/migrations/20210809085801_create_users.exs @@ -0,0 +1,12 @@ +defmodule Ketbin.Repo.Migrations.CreateUsers do + use Ecto.Migration + + def change do + create table(:users) do + add :firebase_id, :string + + timestamps() + end + + end +end