changedCHANGELOG.md
 
@@ -11,6 +11,17 @@
11
11
12
12
## develop
13
13
14
+## 2.0.5 (2023-12-23)
15
+
16
+- [UPDATE] Elixir 1.16 に対応
17
+- [UPDATE] 依存ライブラリを更新
18
+ - ecto_sql: 3.10.2 → 3.11.1
19
+ - memoize: 1.4.1 → 1.4.2
20
+ - ex_doc: 0.29.4 → 0.31.0
21
+ - myxql: 0.6.3 → 0.6.4
22
+- [UPDATE] Elixir 1.14 以上の場合、`Yacto.Migration.Structure` を inspect する際に Map データをソートして文字列に変換する
23
+- [CHANGE] サポートする Elixir のバージョンを 1.9 から 1.11 に上げる
24
+
14
25
## 2.0.4 (2023-06-22)
15
26
16
27
- [UPDATE] Elixir 1.15 に対応
changedhex_metadata.config
 
@@ -1,21 +1,21 @@
1
1
{<<"links">>,[{<<"GitHub">>,<<"https://github.com/gumi/yacto">>}]}.
2
2
{<<"name">>,<<"yacto">>}.
3
-{<<"version">>,<<"2.0.4">>}.
3
+{<<"version">>,<<"2.0.5">>}.
4
4
{<<"description">>,
5
5
<<"A library for automatically generating a migration file and horizontally partitioning databases">>}.
6
-{<<"elixir">>,<<"~> 1.9">>}.
6
+{<<"elixir">>,<<"~> 1.11">>}.
7
7
{<<"app">>,<<"yacto">>}.
8
8
{<<"licenses">>,[<<"Apache-2.0">>]}.
9
9
{<<"requirements">>,
10
10
[[{<<"name">>,<<"ecto_sql">>},
11
11
{<<"app">>,<<"ecto_sql">>},
12
12
{<<"optional">>,false},
13
- {<<"requirement">>,<<"~> 3.10">>},
13
+ {<<"requirement">>,<<"~> 3.11">>},
14
14
{<<"repository">>,<<"hexpm">>}],
15
15
[{<<"name">>,<<"myxql">>},
16
16
{<<"app">>,<<"myxql">>},
17
17
{<<"optional">>,false},
18
- {<<"requirement">>,<<"~> 0.6.3">>},
18
+ {<<"requirement">>,<<"~> 0.6.4">>},
19
19
{<<"repository">>,<<"hexpm">>}],
20
20
[{<<"name">>,<<"elixir_uuid">>},
21
21
{<<"app">>,<<"elixir_uuid">>},
 
@@ -41,9 +41,9 @@
41
41
<<"lib/mix/tasks/yacto.ex">>,<<"lib/mix/tasks/yacto.gen.migration.ex">>,
42
42
<<"lib/yacto.ex">>,<<"priv">>,<<"priv/migrations">>,
43
43
<<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Item">>,
44
- <<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Item/0000-default-create-2023_06_22_023525.exs">>,
44
+ <<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Item/0000-default-create-2023_12_22_203107.exs">>,
45
45
<<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Player">>,
46
- <<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Player/0000-player-create-2023_06_22_023525.exs">>,
46
+ <<"priv/migrations/Elixir.Yacto.ShardingTest.Schema.Player/0000-player-create-2023_12_22_203107.exs">>,
47
47
<<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>,<<"LICENSE">>,
48
48
<<"CHANGELOG.md">>]}.
49
49
{<<"build_tools">>,[<<"mix">>]}.
changedlib/yacto/migration/structure.ex
 
@@ -210,7 +210,11 @@ defimpl Inspect, for: Yacto.Migration.Structure do
210
210
211
211
# Elixir 1.14.0 で Inspect.Map.inspect/3 が無くなったので、代わりに /4 を利用する
212
212
if function_exported?(Inspect.Map, :inspect, 3) do
213
- apply(Inspect.Map, :inspect, [value, Inspect.Atom.inspect(Yacto.Migration.Structure, opts), opts])
213
+ apply(Inspect.Map, :inspect, [
214
+ value,
215
+ Inspect.Atom.inspect(Yacto.Migration.Structure, opts),
216
+ opts
217
+ ])
214
218
else
215
219
infos = Yacto.Migration.Structure.__info__(:struct)
216
220
 
@@ -219,6 +223,9 @@ defimpl Inspect, for: Yacto.Migration.Structure do
219
223
|> Enum.filter(fn %{field: field} -> field not in drop_keys end)
220
224
|> Enum.sort_by(fn %{field: field} -> field end)
221
225
226
+ # マップをソートするオプションを付ける(Elixir 1.14 以上)
227
+ opts = put_in(opts.custom_options[:sort_maps], true)
228
+
222
229
apply(Inspect.Map, :inspect, [
223
230
value,
224
231
Inspect.Atom.inspect(Yacto.Migration.Structure, opts),
changedmix.exs
 
@@ -2,13 +2,13 @@ defmodule Yacto.Mixfile do
2
2
use Mix.Project
3
3
4
4
@source_url "https://github.com/gumi/yacto"
5
- @version "2.0.4"
5
+ @version "2.0.5"
6
6
7
7
def project do
8
8
[
9
9
app: :yacto,
10
10
version: @version,
11
- elixir: "~> 1.9",
11
+ elixir: "~> 1.11",
12
12
elixirc_paths: elixirc_paths(Mix.env()),
13
13
elixirc_options: [all_warnings: true, warnings_as_errors: true],
14
14
start_permanent: Mix.env() == :prod,
 
@@ -32,9 +32,9 @@ defmodule Yacto.Mixfile do
32
32
# Run "mix help deps" to learn about dependencies.
33
33
defp deps do
34
34
[
35
- {:ecto_sql, "~> 3.10"},
35
+ {:ecto_sql, "~> 3.11"},
36
36
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
37
- {:myxql, "~> 0.6.3"},
37
+ {:myxql, "~> 0.6.4"},
38
38
{:elixir_uuid, "~> 1.2"},
39
39
{:memoize, "~> 1.4"},
40
40
{:power_assert, "~> 0.3.0", only: :test}
removedpriv/migrations/Elixir.Yacto.ShardingTest.Schema.Item/0000-default-create-2023_06_22_023525.exs
 
@@ -1,19 +0,0 @@
1
-defmodule Yacto.ShardingTest.Schema.Item.Migration0000 do
2
- use Ecto.Migration
3
-
4
- def change() do
5
- create table("yacto_shardingtest_schema_item")
6
- alter table("yacto_shardingtest_schema_item") do
7
- add(:name, :string, [])
8
- end
9
- :ok
10
- end
11
-
12
- def __migration__(:structure) do
13
- %Yacto.Migration.Structure{field_sources: %{id: :id, name: :name}, fields: [:id, :name], source: "yacto_shardingtest_schema_item", types: %{id: :id, name: :string}}
14
- end
15
-
16
- def __migration__(:version) do
17
- 0
18
- end
19
-end
addedpriv/migrations/Elixir.Yacto.ShardingTest.Schema.Item/0000-default-create-2023_12_22_203107.exs
 
@@ -0,0 +1,19 @@
1
+defmodule Yacto.ShardingTest.Schema.Item.Migration0000 do
2
+ use Ecto.Migration
3
+
4
+ def change() do
5
+ create table("yacto_shardingtest_schema_item")
6
+ alter table("yacto_shardingtest_schema_item") do
7
+ add(:name, :string, [])
8
+ end
9
+ :ok
10
+ end
11
+
12
+ def __migration__(:structure) do
13
+ %Yacto.Migration.Structure{field_sources: %{id: :id, name: :name}, fields: [:id, :name], source: "yacto_shardingtest_schema_item", types: %{id: :id, name: :string}}
14
+ end
15
+
16
+ def __migration__(:version) do
17
+ 0
18
+ end
19
+end
removedpriv/migrations/Elixir.Yacto.ShardingTest.Schema.Player/0000-player-create-2023_06_22_023525.exs
 
@@ -1,19 +0,0 @@
1
-defmodule Yacto.ShardingTest.Schema.Player.Migration0000 do
2
- use Ecto.Migration
3
-
4
- def change() do
5
- create table("yacto_shardingtest_schema_player")
6
- alter table("yacto_shardingtest_schema_player") do
7
- add(:name, :string, [])
8
- end
9
- :ok
10
- end
11
-
12
- def __migration__(:structure) do
13
- %Yacto.Migration.Structure{field_sources: %{id: :id, name: :name}, fields: [:id, :name], source: "yacto_shardingtest_schema_player", types: %{id: :id, name: :string}}
14
- end
15
-
16
- def __migration__(:version) do
17
- 0
18
- end
19
-end
addedpriv/migrations/Elixir.Yacto.ShardingTest.Schema.Player/0000-player-create-2023_12_22_203107.exs
 
@@ -0,0 +1,19 @@
1
+defmodule Yacto.ShardingTest.Schema.Player.Migration0000 do
2
+ use Ecto.Migration
3
+
4
+ def change() do
5
+ create table("yacto_shardingtest_schema_player")
6
+ alter table("yacto_shardingtest_schema_player") do
7
+ add(:name, :string, [])
8
+ end
9
+ :ok
10
+ end
11
+
12
+ def __migration__(:structure) do
13
+ %Yacto.Migration.Structure{field_sources: %{id: :id, name: :name}, fields: [:id, :name], source: "yacto_shardingtest_schema_player", types: %{id: :id, name: :string}}
14
+ end
15
+
16
+ def __migration__(:version) do
17
+ 0
18
+ end
19
+end