Update migrations
This commit is contained in:
parent
50abfe4748
commit
57efda7638
12 changed files with 56 additions and 35 deletions
|
@ -1,16 +0,0 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateFollows do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:follows, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :user_id, references(:users, on_delete: :delete_all), null: false
|
||||
add :target_id, references(:users, on_delete: :delete_all), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:follows, [:user_id, :target_id])
|
||||
create index(:follows, [:target_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue