Skip to content

Commit 904f853

Browse files
committed
add db migration for experiences
1 parent 607800f commit 904f853

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
defmodule Algora.Repo.Migrations.CreateExperiences do
2+
use Ecto.Migration
3+
4+
def change do
5+
create table(:experiences, primary_key: false) do
6+
add :id, :string, primary_key: true
7+
add :user_id, references(:users, type: :string, on_delete: :delete_all), null: false
8+
add :title, :text, null: false
9+
add :company, :text, null: false
10+
add :employment_type, :string
11+
add :location, :text
12+
add :description, :text
13+
add :skills, {:array, :text}, default: []
14+
add :start_date, :date
15+
add :end_date, :date
16+
add :is_current, :boolean, default: false
17+
add :duration_text, :text
18+
add :company_url, :text
19+
add :source, :string
20+
21+
timestamps()
22+
end
23+
24+
create index(:experiences, [:user_id])
25+
create index(:experiences, [:start_date])
26+
create index(:experiences, [:user_id, :start_date])
27+
create index(:experiences, [:user_id, :is_current])
28+
end
29+
end

0 commit comments

Comments
 (0)