Skip to content

Commit 368ae5e

Browse files
committed
feat: lead schemas
1 parent dbe569a commit 368ae5e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
defmodule Algora.Repo.Migrations.CreateLeadsAndLeadJobs do
2+
use Ecto.Migration
3+
4+
def change do
5+
create table(:leads) do
6+
add :handle, :citext, null: false
7+
add :name, :string, null: false
8+
add :bio, :text
9+
add :avatar_url, :text
10+
11+
timestamps()
12+
end
13+
14+
create unique_index(:leads, [:handle])
15+
16+
create table(:lead_jobs) do
17+
add :lead_id, references(:leads, on_delete: :delete_all), null: false
18+
add :title, :string, null: false
19+
add :description, :text
20+
add :tech_stack, {:array, :citext}, default: []
21+
add :match_ids, {:array, :string}, default: []
22+
add :location, :string
23+
add :countries, {:array, :citext}, default: []
24+
add :regions, {:array, :citext}, default: []
25+
26+
timestamps()
27+
end
28+
29+
create index(:lead_jobs, [:lead_id])
30+
end
31+
end

0 commit comments

Comments
 (0)