From 7873ad8c09fbe60098d6e917dab63558afa1815d Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Mon, 8 Apr 2024 23:57:30 -0700 Subject: [PATCH] Allow for sqlite ecto. Make migrations compatible with sqlite. Update the migrations for sqlite. Update javascript dependencies. Fix error with null permissions due to lack of loading the user id. Update dependencies versions in mix.exs and mix.lock --- .github/workflows/uro_release_x86_64.yml | 62 ++++++++++--------- config/dev.exs | 9 +-- lib/uro/accounts.ex | 6 +- lib/uro/accounts/user_privilege_ruleset.ex | 3 + lib/uro/events/event.ex | 3 + lib/uro/repo.ex | 2 +- lib/uro/v_sekai/shard.ex | 3 + mix.exs | 8 ++- mix.lock | 15 +++-- .../20200514192900_create_users.exs | 4 +- .../20200521055257_create_user_identities.exs | 2 +- .../20200704102003_create_shards.exs | 3 +- .../20200704102214_create_avatars.exs | 2 +- .../migrations/20200704102315_create_maps.exs | 2 +- .../20200709121022_create_events.exs | 3 +- .../20200709140357_create_friendships.exs | 6 +- .../20200709164441_create_props.exs | 2 +- ...24032421_create_user_privilege_ruleset.exs | 3 +- .../20201130101113_create_identity_proofs.exs | 2 +- 19 files changed, 79 insertions(+), 61 deletions(-) diff --git a/.github/workflows/uro_release_x86_64.yml b/.github/workflows/uro_release_x86_64.yml index 23d68e3..f66eff6 100644 --- a/.github/workflows/uro_release_x86_64.yml +++ b/.github/workflows/uro_release_x86_64.yml @@ -11,21 +11,36 @@ jobs: runs-on: ubuntu-latest container: - image: hexpm/elixir:1.12.3-erlang-24.0.5-ubuntu-focal-20210325 + image: hexpm/elixir:1.16.2-erlang-24.3.4.17-ubuntu-focal-20240216 steps: - uses: actions/checkout@v2 + - name: Install system dependencies + run: | + apt update + apt install -y build-essential erlang-dev curl git + + - name: Install foundationdb dependency + run: | + set -e + curl -L https://github.com/apple/foundationdb/releases/download/7.1.53/foundationdb-clients_7.1.53-1_amd64.deb --output fdb-client.deb + dpkg -i fdb-client.deb + curl -L https://github.com/apple/foundationdb/releases/download/7.1.53/foundationdb-server_7.1.53-1_amd64.deb --output fdb-server.deb + dpkg -i fdb-server.deb + apt update && sudo apt install -y libfuse3-dev execstack + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Set up Elixir run: | mix local.hex --force mix local.rebar --force - - name: Install system dependencies - run: | - apt update - apt install -y build-essential erlang-dev curl - - name: Restore dependencies cache uses: actions/cache@v2 with: @@ -39,31 +54,20 @@ jobs: - name: Compile code run: mix compile - - name: Install CockroachDB - run: | - curl -s https://binaries.cockroachdb.com/cockroach-v23.2.0-rc.1.linux-amd64.tgz | tar xvz - mkdir -p ${{ runner.temp }}/cockroach - cp cockroach-v23.2.0-rc.1.linux-amd64/cockroach ${{ runner.temp }}/cockroach/ - echo "${{ runner.temp }}/cockroach" >> $GITHUB_PATH - - - name: Start CockroachDB - run: | - cockroach start-single-node --insecure --background - - - name: Wait for CockroachDB to be ready - run: | - until cockroach sql --execute="SELECT 1" --insecure; do sleep 1; done - - - name: Setup Database - run: MIX_ENV=test mix ecto.setup - - - name: Run Seeds - run: MIX_ENV=test mix run priv/repo/test_seeds.exs - - name: Run tests - id: test_step continue-on-error: true - run: mix test | tee test_output.txt; test ${PIPESTATUS[0]} -eq 0 + id: test_step + run: | + set -e + chmod +x ./rust_src/target/release/mvstore + export RUST_LOG=error + ./rust_src/target/release/mvstore --data-plane 127.0.0.1:7000 --admin-api 127.0.0.1:7001 --metadata-prefix mvstore-test --raw-data-prefix m --auto-create-namespace --cluster /etc/foundationdb/fdb.cluster & + sleep 1 + curl http://localhost:7001/api/create_namespace -d '{"key":"uro_dev.sqlite3","metadata":""}' + sleep 1 + MIX_ENV=test mix ecto.setup + MIX_ENV=test mix run priv/repo/test_seeds.exs + mix test | tee test_output.txt; test ${PIPESTATUS[0]} -eq 0 - name: Upload test results uses: actions/upload-artifact@v2 diff --git a/config/dev.exs b/config/dev.exs index 5b993b5..e335f78 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -4,12 +4,9 @@ db_hostname = System.get_env("URO_LOCAL_DB") || "localhost" # Configure your database config :uro, Uro.Repo, - adapter: Ecto.Adapaters.Postgres, - username: "root", - password: "", - port: "26257", - database: "uro_dev", - hostname: db_hostname, + adapter: Ecto.Adapters.SQLite3, + database: "uro_dev.sqlite3", + datetime_type: :text_datetime, show_sensitive_data_on_connection_error: true, pool_size: 10 diff --git a/lib/uro/accounts.ex b/lib/uro/accounts.ex index 89fb309..70c93a3 100644 --- a/lib/uro/accounts.ex +++ b/lib/uro/accounts.ex @@ -64,15 +64,15 @@ defmodule Uro.Accounts do |> Repo.preload(@user_associated_schemas) end - def create_user_privilege_ruleset_for_user(user, attrs \\ %{}) do + def create_user_privilege_ruleset_for_user(user) do user - |> Ecto.build_assoc(:user_privilege_ruleset, attrs) + |> Ecto.build_assoc(:user_privilege_ruleset, %UserPrivilegeRuleset{user_id: user.id}) |> Repo.insert() end def create_associated_entries_for_user(user) do user - |> create_user_privilege_ruleset_for_user + |> create_user_privilege_ruleset_for_user() user end diff --git a/lib/uro/accounts/user_privilege_ruleset.ex b/lib/uro/accounts/user_privilege_ruleset.ex index 929b6af..57ecf70 100644 --- a/lib/uro/accounts/user_privilege_ruleset.ex +++ b/lib/uro/accounts/user_privilege_ruleset.ex @@ -5,6 +5,9 @@ defmodule Uro.Accounts.UserPrivilegeRuleset do @derive {Jason.Encoder, only: [:is_admin, :can_upload_avatars, :can_upload_maps, :can_upload_props]} + @primary_key {:id, :binary_id, autogenerate: true} + @foreign_key_type :binary_id + @derive {Phoenix.Param, key: :id} schema "user_privilege_rulesets" do belongs_to :user, Uro.Accounts.User, foreign_key: :user_id, type: :binary_id diff --git a/lib/uro/events/event.ex b/lib/uro/events/event.ex index f5461e3..d70d9e8 100644 --- a/lib/uro/events/event.ex +++ b/lib/uro/events/event.ex @@ -2,6 +2,9 @@ defmodule Uro.Events.Event do use Ecto.Schema import Ecto.Changeset + @primary_key {:id, :binary_id, autogenerate: true} + @foreign_key_type :binary_id + @derive {Phoenix.Param, key: :id} schema "events" do field :description, :string field :name, :string diff --git a/lib/uro/repo.ex b/lib/uro/repo.ex index 0f2bab2..84102fb 100644 --- a/lib/uro/repo.ex +++ b/lib/uro/repo.ex @@ -1,7 +1,7 @@ defmodule Uro.Repo do use Ecto.Repo, otp_app: :uro, - adapter: Ecto.Adapters.Postgres + adapter: Ecto.Adapters.SQLite3 use Scrivener, page_size: 10 end diff --git a/lib/uro/v_sekai/shard.ex b/lib/uro/v_sekai/shard.ex index a84435e..fe7e561 100644 --- a/lib/uro/v_sekai/shard.ex +++ b/lib/uro/v_sekai/shard.ex @@ -3,6 +3,9 @@ defmodule Uro.VSekai.Shard do use Ecto.Schema import Ecto.Changeset + @primary_key {:id, :binary_id, autogenerate: true} + @foreign_key_type :binary_id + @derive {Phoenix.Param, key: :id} schema "shards" do belongs_to :user, Uro.Accounts.User, foreign_key: :user_id, type: :binary_id diff --git a/mix.exs b/mix.exs index 2daac54..9bf36c0 100644 --- a/mix.exs +++ b/mix.exs @@ -38,7 +38,7 @@ defmodule Uro.MixProject do {:phoenix_ecto, "~> 4.4"}, {:phoenix_live_view, "~> 0.20.3"}, {:phoenix_view, "~> 2.0"}, - {:ecto_sql, "~> 3.5.3"}, + {:ecto_sql, "~> 3.11"}, {:postgrex, ">= 0.0.0"}, {:phoenix_html, "~> 3.3"}, {:phoenix_live_reload, "~> 1.3", only: :dev}, @@ -50,11 +50,13 @@ defmodule Uro.MixProject do {:bcrypt_elixir, "~> 2.3"}, {:pow, "~> 1.0"}, {:email_checker, "~> 0.1.4"}, - {:pow_assent, "~> 0.4.10"}, - {:ssl_verify_fun, "~> 1.1"}, + {:pow_assent, "~> 0.4.18"}, + {:ssl_verify_fun, "~> 1.1.6"}, {:phoenix_swagger, "~> 0.8.3"}, {:ex_json_schema, "~> 0.7.4"}, {:remote_ip, "~> 1.0"}, + {:ecto_sqlite3, "~> 0.13.0"}, + {:exqlite, [env: :prod, git: "https://github.com/V-Sekai/elixir-mvsqlite.git", override: true]}, {:waffle, "~> 1.1"}, {:waffle_ecto, "~> 0.0.10"}, {:swoosh, "~> 1.3"}, diff --git a/mix.lock b/mix.lock index cf7c92e..90263d0 100644 --- a/mix.lock +++ b/mix.lock @@ -2,21 +2,24 @@ "assent": {:hex, :assent, "0.2.9", "e3cdbc8f2e4f8d02c4c490ef8c2148bb1bc0d81aa0648f09addc5918d9a1cd5a", [:mix], [{:certifi, ">= 0.0.0", [hex: :certifi, repo: "hexpm", optional: true]}, {:finch, "~> 0.15", [hex: :finch, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: true]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:req, "~> 0.4", [hex: :req, repo: "hexpm", optional: true]}, {:ssl_verify_fun, ">= 0.0.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: true]}], "hexpm", "5f9562bda90bef7bd3f1b9a348520a5631b86c85145346bb7edb8a7ebbad8e86"}, "bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.1", "5114d780459a04f2b4aeef52307de23de961b69e13a5cd98a911e39fda13f420", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "42182d5f46764def15bf9af83739e3bf4ad22661b1c34fc3e88558efced07279"}, "castore": {:hex, :castore, "1.0.6", "ffc42f110ebfdafab0ea159cd43d31365fa0af0ce4a02ecebf1707ae619ee727", [:mix], [], "hexpm", "374c6e7ca752296be3d6780a6d5b922854ffcc74123da90f2f328996b962d33a"}, + "cc_precompiler": {:hex, :cc_precompiler, "0.1.10", "47c9c08d8869cf09b41da36538f62bc1abd3e19e41701c2cea2675b53c704258", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f6e046254e53cd6b41c6bacd70ae728011aa82b2742a80d6e2214855c6e06b22"}, "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"}, "comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"}, - "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, + "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"}, "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "ecto": {:hex, :ecto, "3.5.8", "8ebf12be6016cb99313348ba7bb4612f4114b9a506d6da79a2adc7ef449340bc", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ea0be182ea8922eb7742e3ae8e71b67ee00ae177de1bf76210299a5f16ba4c77"}, - "ecto_sql": {:hex, :ecto_sql, "3.5.4", "a9e292c40bd79fff88885f95f1ecd7b2516e09aa99c7dd0201aa84c54d2358e4", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1fff1a28a898d7bbef263f1f3ea425b04ba9f33816d843238c84eff883347343"}, + "ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"}, + "ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"}, + "ecto_sqlite3": {:hex, :ecto_sqlite3, "0.13.0", "0c3dc8ff24f378ef108619fd5c18bbbea43cb86dc8733c1c596bd7e0a5bb9e28", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.11", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.9", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "8ab7d8bf6663b811b80c9fa8730780f7077106c40a3fdbae384fe8f82315b257"}, "elixir_make": {:hex, :elixir_make, "0.8.3", "d38d7ee1578d722d89b4d452a3e36bcfdc644c618f0d063b874661876e708683", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "5c99a18571a756d4af7a4d89ca75c28ac899e6103af6f223982f09ce44942cc9"}, "email_checker": {:hex, :email_checker, "0.1.4", "6c9914039277da0810107e229ffc28c09b09af7663bfa1f85268fdb4ddc8f174", [:mix], [{:socket, "~> 0.3.1", [hex: :socket, repo: "hexpm", optional: false]}], "hexpm", "5f35d5d4ee3c8a789e92c4dd7916e1c1744c4ceb9a9661ae1b17a7a71fe9e5aa"}, "ex_json_schema": {:hex, :ex_json_schema, "0.7.4", "09eb5b0c8184e5702bc89625a9d0c05c7a0a845d382e9f6f406a0fc1c9a8cc3f", [:mix], [], "hexpm", "45c67fa840f0d719a2b5578126dc29bcdc1f92499c0f61bcb8a3bcb5935f9684"}, "expo": {:hex, :expo, "0.5.2", "beba786aab8e3c5431813d7a44b828e7b922bfa431d6bfbada0904535342efe2", [:mix], [], "hexpm", "8c9bfa06ca017c9cb4020fabe980bc7fdb1aaec059fd004c2ab3bff03b1c599c"}, + "exqlite": {:git, "https://github.com/V-Sekai/elixir-mvsqlite.git", "5bd2584b68440721d3fc482767c64f1c26b8f9b7", []}, "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, "gettext": {:hex, :gettext, "0.24.0", "6f4d90ac5f3111673cbefc4ebee96fe5f37a114861ab8c7b7d5b30a1108ce6d8", [:mix], [{:expo, "~> 0.5.1", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "bdf75cdfcbe9e4622dd18e034b227d77dd17f0f133853a1c73b97b3d6c770e8b"}, "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~>2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, @@ -40,17 +43,17 @@ "plug_cowboy": {:hex, :plug_cowboy, "2.7.1", "87677ffe3b765bc96a89be7960f81703223fe2e21efa42c125fcd0127dd9d6b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "02dbd5f9ab571b864ae39418db7811618506256f6d13b4a45037e5fe78dc5de3"}, "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, - "postgrex": {:hex, :postgrex, "0.15.13", "7794e697481799aee8982688c261901de493eb64451feee6ea58207d7266d54a", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "3ffb76e1a97cfefe5c6a95632a27ffb67f28871c9741fb585f9d1c3cd2af70f1"}, + "postgrex": {:hex, :postgrex, "0.17.5", "0483d054938a8dc069b21bdd636bf56c487404c241ce6c319c1f43588246b281", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "50b8b11afbb2c4095a3ba675b4f055c416d0f3d7de6633a595fc131a828a67eb"}, "pow": {:hex, :pow, "1.0.37", "4adc0a8b18810c20766a6be2e035fcd0ccf3585c5976b58889dcf989b5788aa9", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.3.0 and < 1.8.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.0.0 and < 5.0.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, ">= 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:plug, ">= 1.5.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "2ede2deb1799297a0edd7487fa15faab9a2d570e9d2d03fbc1b4ba31b40abf19"}, "pow_assent": {:hex, :pow_assent, "0.4.18", "8f3d333c99bc1333a31e6939c0784c966cc262145f523fa31a86fd2d10cf8ff2", [:mix], [{:assent, "~> 0.2.8", [hex: :assent, repo: "hexpm", optional: false]}, {:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, ">= 1.3.0 and < 1.8.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.0.0 and <= 5.0.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_live_view, ">= 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:plug, ">= 1.5.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:pow, "~> 1.0.29", [hex: :pow, repo: "hexpm", optional: false]}], "hexpm", "3214be0680e4f9870ddf183019ce86d24ce0a676799f435b234fe6300287054a"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "remote_ip": {:hex, :remote_ip, "1.1.0", "cb308841595d15df3f9073b7c39243a1dd6ca56e5020295cb012c76fbec50f2d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "616ffdf66aaad6a72fc546dabf42eed87e2a99e97b09cbd92b10cc180d02ed74"}, + "remote_ip": {:hex, :remote_ip, "1.0.0", "3d7fb45204a5704443f480cee9515e464997f52c35e0a60b6ece1f81484067ae", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "9e9fcad4e50c43b5234bb6a9629ed6ab223f3ed07147bd35470e4ee5c8caf907"}, "scrivener": {:hex, :scrivener, "2.7.2", "1d913c965ec352650a7f864ad7fd8d80462f76a32f33d57d1e48bc5e9d40aba2", [:mix], [], "hexpm", "7866a0ec4d40274efbee1db8bead13a995ea4926ecd8203345af8f90d2b620d9"}, "scrivener_ecto": {:hex, :scrivener_ecto, "2.7.0", "cf64b8cb8a96cd131cdbcecf64e7fd395e21aaa1cb0236c42a7c2e34b0dca580", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm", "e809f171687806b0031129034352f5ae44849720c48dd839200adeaf0ac3e260"}, "socket": {:hex, :socket, "0.3.13", "98a2ab20ce17f95fb512c5cadddba32b57273e0d2dba2d2e5f976c5969d0c632", [:mix], [], "hexpm", "f82ea9833ef49dde272e6568ab8aac657a636acb4cf44a7de8a935acb8957c2e"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "swoosh": {:hex, :swoosh, "1.16.3", "4ab7dc429e84afaf8ffe1c7c06ce1acbc7ddde758d2cb9152dd2ac32289d5498", [:mix], [{:bandit, ">= 1.0.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mua, "~> 0.1.0", [hex: :mua, repo: "hexpm", optional: true]}, {:multipart, "~> 0.4", [hex: :multipart, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:req, "~> 0.4 or ~> 1.0", [hex: :req, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ff70980087650a72951ebd109a286d83c270e2b6610aba447140562adff8cf0a"}, - "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, "waffle": {:hex, :waffle, "1.1.8", "9257275a10e7b58f968bf891d2433ecaeced801edc064b3c100dc510848b9760", [:mix], [{:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:ex_aws_s3, "~> 2.1", [hex: :ex_aws_s3, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "30f1b00998ddb626d98f014bb7606173ff18610b1e89431ff84442dc1c94c6cd"}, "waffle_ecto": {:hex, :waffle_ecto, "0.0.12", "e5c17c49b071b903df71861c642093281123142dc4e9908c930db3e06795b040", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:waffle, "~> 1.0", [hex: :waffle, repo: "hexpm", optional: false]}], "hexpm", "585fe6371057066d2e8e3383ddd7a2437ff0668caf3f4cbf5a041e0de9837168"}, diff --git a/priv/repo/migrations/20200514192900_create_users.exs b/priv/repo/migrations/20200514192900_create_users.exs index 383a026..b2d9c8c 100644 --- a/priv/repo/migrations/20200514192900_create_users.exs +++ b/priv/repo/migrations/20200514192900_create_users.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateUsers do use Ecto.Migration def change do - create table(:users, primary_key: false) do + create table(:users, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :email, :string, null: false add :password_hash, :string @@ -10,7 +10,7 @@ defmodule Uro.Repo.Migrations.CreateUsers do add :username, :string add :display_name, :string - add :email_notifications, :bool, default: false + add :email_notifications, :boolean, default: false add :profile_picture, :string diff --git a/priv/repo/migrations/20200521055257_create_user_identities.exs b/priv/repo/migrations/20200521055257_create_user_identities.exs index 5df041c..6978150 100644 --- a/priv/repo/migrations/20200521055257_create_user_identities.exs +++ b/priv/repo/migrations/20200521055257_create_user_identities.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateUserIdentities do use Ecto.Migration def change do - create table(:user_identities, primary_key: false) do + create table(:user_identities, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :provider, :string, null: false add :uid, :string, null: false diff --git a/priv/repo/migrations/20200704102003_create_shards.exs b/priv/repo/migrations/20200704102003_create_shards.exs index d1e1735..6e6b296 100644 --- a/priv/repo/migrations/20200704102003_create_shards.exs +++ b/priv/repo/migrations/20200704102003_create_shards.exs @@ -2,7 +2,8 @@ defmodule Uro.Repo.Migrations.CreateShards do use Ecto.Migration def change do - create table(:shards) do + create table(:shards, primary_key: false, options: "STRICT, WITHOUT ROWID") do + add :id, :uuid, primary_key: true add :address, :string add :port, :integer add :name, :string diff --git a/priv/repo/migrations/20200704102214_create_avatars.exs b/priv/repo/migrations/20200704102214_create_avatars.exs index 60d9e68..463ca05 100644 --- a/priv/repo/migrations/20200704102214_create_avatars.exs +++ b/priv/repo/migrations/20200704102214_create_avatars.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateAvatars do use Ecto.Migration def change do - create table(:avatars, primary_key: false) do + create table(:avatars, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :name, :string add :description, :text diff --git a/priv/repo/migrations/20200704102315_create_maps.exs b/priv/repo/migrations/20200704102315_create_maps.exs index 4225b94..60ba555 100644 --- a/priv/repo/migrations/20200704102315_create_maps.exs +++ b/priv/repo/migrations/20200704102315_create_maps.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateMaps do use Ecto.Migration def change do - create table(:maps, primary_key: false) do + create table(:maps, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :name, :string add :description, :text diff --git a/priv/repo/migrations/20200709121022_create_events.exs b/priv/repo/migrations/20200709121022_create_events.exs index 8c79ccc..d45bb9c 100644 --- a/priv/repo/migrations/20200709121022_create_events.exs +++ b/priv/repo/migrations/20200709121022_create_events.exs @@ -2,7 +2,8 @@ defmodule Uro.Repo.Migrations.CreateEvents do use Ecto.Migration def change do - create table(:events) do + create table(:events, primary_key: false, options: "STRICT, WITHOUT ROWID") do + add :id, :uuid, primary_key: true add :description, :string add :name, :string diff --git a/priv/repo/migrations/20200709140357_create_friendships.exs b/priv/repo/migrations/20200709140357_create_friendships.exs index 8bddf00..1df89c2 100644 --- a/priv/repo/migrations/20200709140357_create_friendships.exs +++ b/priv/repo/migrations/20200709140357_create_friendships.exs @@ -2,10 +2,10 @@ defmodule Uro.Repo.Migrations.CreateFriendships do use Ecto.Migration def change do - create table(:friendships, primary_key: false) do + create table(:friendships, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true - add :user_id, references(:users, type: :uuid) - add :friend_id, references(:users, type: :uuid) + add :from_user_id, references(:users, type: :uuid) + add :to_user_id, references(:users, type: :uuid) timestamps() end diff --git a/priv/repo/migrations/20200709164441_create_props.exs b/priv/repo/migrations/20200709164441_create_props.exs index 66390a5..a36b7a8 100644 --- a/priv/repo/migrations/20200709164441_create_props.exs +++ b/priv/repo/migrations/20200709164441_create_props.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateProps do use Ecto.Migration def change do - create table(:props, primary_key: false) do + create table(:props, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :name, :string add :description, :text diff --git a/priv/repo/migrations/20201124032421_create_user_privilege_ruleset.exs b/priv/repo/migrations/20201124032421_create_user_privilege_ruleset.exs index 84a0572..497f540 100644 --- a/priv/repo/migrations/20201124032421_create_user_privilege_ruleset.exs +++ b/priv/repo/migrations/20201124032421_create_user_privilege_ruleset.exs @@ -2,7 +2,8 @@ defmodule Uro.Repo.Migrations.CreateUserPrivileges do use Ecto.Migration def change do - create table(:user_privilege_rulesets) do + create table(:user_privilege_rulesets, primary_key: false, options: "STRICT, WITHOUT ROWID") do + add :id, :uuid, primary_key: true add :user_id, references(:users, type: :uuid, on_delete: :delete_all) add :is_admin, :boolean, default: false, null: false diff --git a/priv/repo/migrations/20201130101113_create_identity_proofs.exs b/priv/repo/migrations/20201130101113_create_identity_proofs.exs index e58bd88..5dd8477 100644 --- a/priv/repo/migrations/20201130101113_create_identity_proofs.exs +++ b/priv/repo/migrations/20201130101113_create_identity_proofs.exs @@ -2,7 +2,7 @@ defmodule Uro.Repo.Migrations.CreateIdentityProofs do use Ecto.Migration def change do - create table(:identity_proofs, primary_key: false) do + create table(:identity_proofs, primary_key: false, options: "STRICT, WITHOUT ROWID") do add :id, :uuid, primary_key: true add :user_from_id, references(:users, type: :uuid, on_delete: :delete_all)