Skip to content

Commit 4ddcffe

Browse files
authored
feat: relationship through (#686)
1 parent fc0c6fb commit 4ddcffe

15 files changed

Lines changed: 1505 additions & 165 deletions

File tree

lib/data_layer.ex

Lines changed: 306 additions & 165 deletions
Large diffs are not rendered by default.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"attributes": [
3+
{
4+
"allow_nil?": false,
5+
"default": "fragment(\"gen_random_uuid()\")",
6+
"generated?": false,
7+
"precision": null,
8+
"primary_key?": true,
9+
"references": null,
10+
"scale": null,
11+
"size": null,
12+
"source": "id",
13+
"type": "uuid"
14+
},
15+
{
16+
"allow_nil?": true,
17+
"default": "nil",
18+
"generated?": false,
19+
"precision": null,
20+
"primary_key?": false,
21+
"references": null,
22+
"scale": null,
23+
"size": null,
24+
"source": "retired_at",
25+
"type": "utc_datetime_usec"
26+
},
27+
{
28+
"allow_nil?": false,
29+
"default": "nil",
30+
"generated?": false,
31+
"precision": null,
32+
"primary_key?": false,
33+
"references": {
34+
"deferrable": false,
35+
"destination_attribute": "id",
36+
"destination_attribute_default": null,
37+
"destination_attribute_generated": null,
38+
"index?": false,
39+
"match_type": null,
40+
"match_with": null,
41+
"multitenancy": {
42+
"attribute": null,
43+
"global": null,
44+
"strategy": null
45+
},
46+
"name": "classroom_teachers_classroom_id_fkey",
47+
"on_delete": null,
48+
"on_update": null,
49+
"primary_key?": true,
50+
"schema": "public",
51+
"table": "classrooms"
52+
},
53+
"scale": null,
54+
"size": null,
55+
"source": "classroom_id",
56+
"type": "uuid"
57+
},
58+
{
59+
"allow_nil?": false,
60+
"default": "nil",
61+
"generated?": false,
62+
"precision": null,
63+
"primary_key?": false,
64+
"references": {
65+
"deferrable": false,
66+
"destination_attribute": "id",
67+
"destination_attribute_default": null,
68+
"destination_attribute_generated": null,
69+
"index?": false,
70+
"match_type": null,
71+
"match_with": null,
72+
"multitenancy": {
73+
"attribute": null,
74+
"global": null,
75+
"strategy": null
76+
},
77+
"name": "classroom_teachers_teacher_id_fkey",
78+
"on_delete": null,
79+
"on_update": null,
80+
"primary_key?": true,
81+
"schema": "public",
82+
"table": "teachers"
83+
},
84+
"scale": null,
85+
"size": null,
86+
"source": "teacher_id",
87+
"type": "uuid"
88+
}
89+
],
90+
"base_filter": null,
91+
"check_constraints": [],
92+
"create_table_options": null,
93+
"custom_indexes": [],
94+
"custom_statements": [],
95+
"has_create_action": true,
96+
"hash": "B05DD910F1EE1F8B6151179F105613E642AB242896D76E54C438FC297BC2B822",
97+
"identities": [
98+
{
99+
"all_tenants?": false,
100+
"base_filter": null,
101+
"index_name": "classroom_teachers_unique_classroom_teacher_index",
102+
"keys": [
103+
{
104+
"type": "atom",
105+
"value": "classroom_id"
106+
},
107+
{
108+
"type": "atom",
109+
"value": "teacher_id"
110+
}
111+
],
112+
"name": "unique_classroom_teacher",
113+
"nils_distinct?": true,
114+
"where": null
115+
}
116+
],
117+
"multitenancy": {
118+
"attribute": null,
119+
"global": null,
120+
"strategy": null
121+
},
122+
"repo": "Elixir.AshPostgres.TestRepo",
123+
"schema": null,
124+
"table": "classroom_teachers"
125+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"attributes": [
3+
{
4+
"allow_nil?": false,
5+
"default": "fragment(\"gen_random_uuid()\")",
6+
"generated?": false,
7+
"precision": null,
8+
"primary_key?": true,
9+
"references": null,
10+
"scale": null,
11+
"size": null,
12+
"source": "id",
13+
"type": "uuid"
14+
},
15+
{
16+
"allow_nil?": true,
17+
"default": "nil",
18+
"generated?": false,
19+
"precision": null,
20+
"primary_key?": false,
21+
"references": null,
22+
"scale": null,
23+
"size": null,
24+
"source": "name",
25+
"type": "text"
26+
},
27+
{
28+
"allow_nil?": true,
29+
"default": "nil",
30+
"generated?": false,
31+
"precision": null,
32+
"primary_key?": false,
33+
"references": {
34+
"deferrable": false,
35+
"destination_attribute": "id",
36+
"destination_attribute_default": null,
37+
"destination_attribute_generated": null,
38+
"index?": false,
39+
"match_type": null,
40+
"match_with": null,
41+
"multitenancy": {
42+
"attribute": null,
43+
"global": null,
44+
"strategy": null
45+
},
46+
"name": "classrooms_school_id_fkey",
47+
"on_delete": null,
48+
"on_update": null,
49+
"primary_key?": true,
50+
"schema": "public",
51+
"table": "schools"
52+
},
53+
"scale": null,
54+
"size": null,
55+
"source": "school_id",
56+
"type": "uuid"
57+
}
58+
],
59+
"base_filter": null,
60+
"check_constraints": [],
61+
"create_table_options": null,
62+
"custom_indexes": [],
63+
"custom_statements": [],
64+
"has_create_action": true,
65+
"hash": "E1ACDC9A51CAA0429F0D820BDB97F17280D04962EF2BF250E30C6C78AA4CD061",
66+
"identities": [],
67+
"multitenancy": {
68+
"attribute": null,
69+
"global": null,
70+
"strategy": null
71+
},
72+
"repo": "Elixir.AshPostgres.TestRepo",
73+
"schema": null,
74+
"table": "classrooms"
75+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"attributes": [
3+
{
4+
"allow_nil?": false,
5+
"default": "fragment(\"gen_random_uuid()\")",
6+
"generated?": false,
7+
"precision": null,
8+
"primary_key?": true,
9+
"references": null,
10+
"scale": null,
11+
"size": null,
12+
"source": "id",
13+
"type": "uuid"
14+
},
15+
{
16+
"allow_nil?": true,
17+
"default": "nil",
18+
"generated?": false,
19+
"precision": null,
20+
"primary_key?": false,
21+
"references": null,
22+
"scale": null,
23+
"size": null,
24+
"source": "name",
25+
"type": "text"
26+
}
27+
],
28+
"base_filter": null,
29+
"check_constraints": [],
30+
"create_table_options": null,
31+
"custom_indexes": [],
32+
"custom_statements": [],
33+
"has_create_action": true,
34+
"hash": "8C091BCD2FD84EB8B41BE6B4EA39A02A6ED80DD7FE26698FED90C2452936A2CB",
35+
"identities": [],
36+
"multitenancy": {
37+
"attribute": null,
38+
"global": null,
39+
"strategy": null
40+
},
41+
"repo": "Elixir.AshPostgres.TestRepo",
42+
"schema": null,
43+
"table": "schools"
44+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"attributes": [
3+
{
4+
"allow_nil?": false,
5+
"default": "fragment(\"gen_random_uuid()\")",
6+
"generated?": false,
7+
"precision": null,
8+
"primary_key?": true,
9+
"references": null,
10+
"scale": null,
11+
"size": null,
12+
"source": "id",
13+
"type": "uuid"
14+
},
15+
{
16+
"allow_nil?": true,
17+
"default": "nil",
18+
"generated?": false,
19+
"precision": null,
20+
"primary_key?": false,
21+
"references": null,
22+
"scale": null,
23+
"size": null,
24+
"source": "name",
25+
"type": "text"
26+
},
27+
{
28+
"allow_nil?": false,
29+
"default": "nil",
30+
"generated?": false,
31+
"precision": null,
32+
"primary_key?": false,
33+
"references": {
34+
"deferrable": false,
35+
"destination_attribute": "id",
36+
"destination_attribute_default": null,
37+
"destination_attribute_generated": null,
38+
"index?": false,
39+
"match_type": null,
40+
"match_with": null,
41+
"multitenancy": {
42+
"attribute": null,
43+
"global": null,
44+
"strategy": null
45+
},
46+
"name": "students_classroom_id_fkey",
47+
"on_delete": null,
48+
"on_update": null,
49+
"primary_key?": true,
50+
"schema": "public",
51+
"table": "classrooms"
52+
},
53+
"scale": null,
54+
"size": null,
55+
"source": "classroom_id",
56+
"type": "uuid"
57+
}
58+
],
59+
"base_filter": null,
60+
"check_constraints": [],
61+
"create_table_options": null,
62+
"custom_indexes": [],
63+
"custom_statements": [],
64+
"has_create_action": true,
65+
"hash": "6FD7FFCDA0DF4CF8A38BAB8ABD53FC9A4DB0A10A94A0A19B33A560EF5BD2176F",
66+
"identities": [],
67+
"multitenancy": {
68+
"attribute": null,
69+
"global": null,
70+
"strategy": null
71+
},
72+
"repo": "Elixir.AshPostgres.TestRepo",
73+
"schema": null,
74+
"table": "students"
75+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"attributes": [
3+
{
4+
"allow_nil?": false,
5+
"default": "fragment(\"gen_random_uuid()\")",
6+
"generated?": false,
7+
"precision": null,
8+
"primary_key?": true,
9+
"references": null,
10+
"scale": null,
11+
"size": null,
12+
"source": "id",
13+
"type": "uuid"
14+
},
15+
{
16+
"allow_nil?": true,
17+
"default": "nil",
18+
"generated?": false,
19+
"precision": null,
20+
"primary_key?": false,
21+
"references": null,
22+
"scale": null,
23+
"size": null,
24+
"source": "name",
25+
"type": "text"
26+
}
27+
],
28+
"base_filter": null,
29+
"check_constraints": [],
30+
"create_table_options": null,
31+
"custom_indexes": [],
32+
"custom_statements": [],
33+
"has_create_action": true,
34+
"hash": "F839E78D2BC6DECC46D39A81EC374E65A6A96732FFD01777C1D0A5FE4133AC14",
35+
"identities": [],
36+
"multitenancy": {
37+
"attribute": null,
38+
"global": null,
39+
"strategy": null
40+
},
41+
"repo": "Elixir.AshPostgres.TestRepo",
42+
"schema": null,
43+
"table": "teachers"
44+
}

0 commit comments

Comments
 (0)