Created
October 22, 2016 12:03
-
-
Save bnhansn/dbeb29339f0736139cd62876bad294fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Sling.Repo.Migrations.CreateMessage do | |
| use Ecto.Migration | |
| def change do | |
| create table(:messages) do | |
| add :text, :string, null: false | |
| add :room_id, references(:rooms, on_delete: :nothing), null: false | |
| add :user_id, references(:users, on_delete: :nothing), null: false | |
| timestamps() | |
| end | |
| create index(:messages, [:room_id]) | |
| create index(:messages, [:user_id]) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment