Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
26
priv/repo/migrations/20180110092600_create_events.exs
Normal file
26
priv/repo/migrations/20180110092600_create_events.exs
Normal file
@@ -0,0 +1,26 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateEvents do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:events) do
|
||||
add :title, :string, null: false
|
||||
add :slug, :string, null: false
|
||||
add :description, :string, null: true
|
||||
add :begins_on, :datetimetz
|
||||
add :ends_on, :datetimetz
|
||||
add :geom, :geometry
|
||||
add :state, :integer, null: false
|
||||
add :public, :boolean, null: false
|
||||
add :large_image, :string
|
||||
add :thumbnail, :string
|
||||
add :publish_at, :datetimetz
|
||||
add :organizer_id, references(:accounts, on_delete: :nothing), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:events, [:organizer_id])
|
||||
create unique_index(:events, [:slug])
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user