Update migrations
This commit is contained in:
parent
50abfe4748
commit
57efda7638
12 changed files with 56 additions and 35 deletions
|
@ -1,20 +0,0 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateModerationLogs do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:moderation_logs, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :moderator_id, references(:users, on_delete: :nilify_all), null: false
|
||||
add :target_type, :string, null: false
|
||||
add :target_id, :string, null: false
|
||||
add :action, :string, null: false
|
||||
add :reason, :text
|
||||
add :metadata, :map
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:moderation_logs, [:moderator_id])
|
||||
create index(:moderation_logs, [:target_type, :target_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue