Created
October 21, 2016 19:00
-
-
Save bnhansn/12154286bc32ef53d8d4722e7bd6a97d 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.CreateUserRoom do | |
| use Ecto.Migration | |
| def change do | |
| create table(:user_rooms) do | |
| add :user_id, references(:users, on_delete: :nothing), null: false | |
| add :room_id, references(:rooms, on_delete: :nothing), null: false | |
| timestamps() | |
| end | |
| create index(:user_rooms, [:user_id]) | |
| create index(:user_rooms, [:room_id]) | |
| create index(:user_rooms, [:user_id, :room_id], unique: true) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment