diff options
Diffstat (limited to 'lib/matrix_app_service/migrations.ex')
-rw-r--r-- | lib/matrix_app_service/migrations.ex | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/matrix_app_service/migrations.ex b/lib/matrix_app_service/migrations.ex new file mode 100644 index 0000000..6ae5344 --- /dev/null +++ b/lib/matrix_app_service/migrations.ex @@ -0,0 +1,27 @@ +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 |