2019-02-11 22:22:35 +00:00
|
|
|
defmodule Frenzy.Repo.Migrations.CreateItems do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:items) do
|
|
|
|
add :guid, :string
|
|
|
|
add :title, :string
|
|
|
|
add :url, :string
|
|
|
|
add :creator, :string
|
|
|
|
add :date, :utc_datetime
|
|
|
|
add :content, :text
|
|
|
|
add :read, :boolean, default: false, null: false
|
|
|
|
add :read_date, :utc_datetime
|
2019-03-11 02:23:28 +00:00
|
|
|
add :feed_id, references(:feeds, on_delete: :delete_all)
|
2019-02-11 22:22:35 +00:00
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
# create index(:items, [:feed])
|
|
|
|
end
|
|
|
|
end
|