Skip to content

Commit 4b256c7

Browse files
committed
add new job fields
1 parent 2725fa7 commit 4b256c7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/algora/jobs/schemas/job_posting.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defmodule Algora.Jobs.JobPosting do
2121
# e.g. ["LATAM", "NA"]
2222
field :regions, {:array, :string}, default: []
2323
field :compensation, :string
24+
field :max_compensation, Money.Ecto.Composite.Type
2425
field :seniority, :string
2526
field :system_tags, {:array, :string}, default: []
2627
field :primary_tech, :string
@@ -29,6 +30,8 @@ defmodule Algora.Jobs.JobPosting do
2930

3031
field :location_meta, :map
3132
field :location_iso_lvl4, :string
33+
field :location_types, {:array, Ecto.Enum}, values: [:remote, :hybrid, :onsite]
34+
field :locations, {:array, :string}
3235

3336
belongs_to :user, User, null: false
3437
has_many :interviews, Algora.Interviews.JobInterview, foreign_key: :job_posting_id
@@ -60,7 +63,10 @@ defmodule Algora.Jobs.JobPosting do
6063
:location_iso_lvl4,
6164
:primary_tech,
6265
:primary_tag,
63-
:full_description
66+
:full_description,
67+
:location_types,
68+
:locations,
69+
:max_compensation
6470
])
6571
|> generate_id()
6672
|> validate_required([:url, :company_name, :company_url, :email])
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
defmodule Algora.Repo.Migrations.AddLocationAndCompensationFieldsToJobPostings do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:job_postings) do
6+
add :location_types, {:array, :string}, default: []
7+
add :locations, {:array, :string}, default: []
8+
add :max_compensation, :money_with_currency
9+
end
10+
end
11+
end

0 commit comments

Comments
 (0)