summaryrefslogblamecommitdiff
path: root/lib/matrix_app_service/migrations.ex
blob: 6ae5344d585167ea20af101ee5e9aafa61b770c0 (plain) (tree)
1
2
3
4
5
6
7
8




                                        


                              


                  
 

                                              

                           


                              


                  


                                              

     
defmodule MatrixAppService.Migrations do
  use Ecto.Migration

  def change do
    create table(:users) do
      add(:local_id, :string)
      add(:remote_id, :string)
      add(:data, :map)

      timestamps()
    end

    create(unique_index(:users, [:local_id]))
    create(unique_index(:users, [:remote_id]))

    create table(:rooms) do
      add(:local_id, :string)
      add(:remote_id, :string)
      add(:data, :map)

      timestamps()
    end

    create(unique_index(:rooms, [:local_id]))
    create(unique_index(:rooms, [:remote_id]))
  end
end