Add models and migrations
This commit is contained in:
parent
182523d36d
commit
9e542bc790
33 changed files with 597 additions and 125 deletions
|
@ -0,0 +1,16 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateMediaAttachments do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:media_attachments) do
|
||||
add :note_id, references(:notes, on_delete: :delete_all), null: false
|
||||
add :file, :string, null: false
|
||||
add :mime_type, :string
|
||||
add :description, :string
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create index(:media_attachments, [:note_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue