Skip to content

Commit

Permalink
Just the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
philosodad committed Feb 21, 2016
1 parent 2229fcf commit be02a67
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config

config :loggex, Loggex.Repo,
adapter: Ecto.Adapters.Postgres,
database: "loggex_repo",
username: "postgres",
password: "postgres",
hostname: "localhost"


# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
Expand Down
11 changes: 11 additions & 0 deletions lib/loggex/logline.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule Loggex.Logline do
use Ecto.Schema
import Ecto.Changeset

schema "loglines" do
field :sender, :string
field :sendtime, Ecto.DateTime
field :responseCode, :integer
field :body, :string
end
end
3 changes: 3 additions & 0 deletions lib/loggex/repo.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule Loggex.Repo do
use Ecto.Repo, otp_app: :loggex
end
12 changes: 12 additions & 0 deletions priv/repo/migrations/20160221045342_add_loglines_table.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule Loggex.Repo.Migrations.AddLoglinesTable do
use Ecto.Migration

def change do
create table(:loglines) do
add :sender, :string
add :sendtime, :datetime
add :responseCode, :integer
add :body, :string
end
end
end

0 comments on commit be02a67

Please sign in to comment.