Skip to content

Commit 3026096

Browse files
authored
Merge pull request #2973 from SeedCompany/edgedb/seeds
2 parents 48e9be4 + 28b35c3 commit 3026096

File tree

6 files changed

+1698
-12
lines changed

6 files changed

+1698
-12
lines changed

.github/workflows/edgedb-schema.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/edgedb.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: EdgeDB
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
Clean:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Node Setup & Yarn Install
11+
uses: ./.github/actions/setup
12+
13+
- uses: edgedb/setup-edgedb@v1
14+
15+
- name: Schema Migrations In Sync
16+
run: edgedb migration status
17+
18+
- name: Validate seed scripts are error free
19+
run: yarn edgedb:seed
20+
shell: bash
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
for fa in {
2+
("Not Specified", 0),
3+
("Asia - Mainland", 1),
4+
("Africa", 2),
5+
("Asia - Islands", 3),
6+
("Asia - South", 4),
7+
("Americas, Eurasia", 5),
8+
("Pacific", 7)
9+
}
10+
union (
11+
(select FundingAccount filter .name = fa.0) ??
12+
(insert FundingAccount {
13+
name := fa.0,
14+
accountNumber := fa.1
15+
})
16+
);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
with
2+
root := (select RootUser),
3+
zones := array_agg((
4+
for name in {
5+
"Americas, Pacific, Eurasia",
6+
"Africa",
7+
"Not Specified",
8+
"Asia"
9+
}
10+
union (
11+
(select FieldZone filter .name = name) ??
12+
(insert FieldZone {
13+
name := name,
14+
director := root
15+
})
16+
)
17+
)),
18+
regions := (
19+
for region in {
20+
("Americas", zones[0]),
21+
("Pacific", zones[0]),
22+
("Eurasia", zones[0]),
23+
("Africa - Southern", zones[1]),
24+
("Africa - Anglophone East", zones[1]),
25+
("Africa - Sahel", zones[1]),
26+
("Africa - Congo Basin", zones[1]),
27+
("Africa - Anglophone West", zones[1]),
28+
("any", zones[2]),
29+
("Asia - Islands", zones[3]),
30+
("Asia - South", zones[3]),
31+
("Asia - Mainland", zones[3]),
32+
}
33+
union (
34+
(select FieldRegion filter .name = region.0) ??
35+
(insert FieldRegion {
36+
name := region.0,
37+
fieldZone := region.1,
38+
director := root
39+
})
40+
)
41+
)
42+
select regions;

0 commit comments

Comments
 (0)