Skip to content

Commit 0ca345d

Browse files
committed
chore: clean up database usage
1 parent f11fe91 commit 0ca345d

21 files changed

Lines changed: 1349 additions & 480 deletions

File tree

.github/workflows/tests.yml

Lines changed: 10 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,12 @@ jobs:
122122

123123
test-integration-sqlite:
124124
needs: [setup, lint, typescript]
125-
name: 'test:integration (sqlite, node ${{ matrix.node-version }})'
125+
name: 'test:integration:sqlite (node ${{ matrix.node-version }})'
126126
runs-on: ubuntu-latest
127127
strategy:
128128
fail-fast: false
129129
matrix:
130130
node-version: [22, 24]
131-
env:
132-
DATABASE_CLIENT: sqlite
133131
steps:
134132
- uses: actions/checkout@v4
135133
- name: Install pnpm
@@ -158,33 +156,12 @@ jobs:
158156

159157
test-integration-postgres:
160158
needs: [setup, lint, typescript]
161-
name: 'test:integration (postgres, node ${{ matrix.node-version }})'
159+
name: 'test:integration:postgres (node ${{ matrix.node-version }})'
162160
runs-on: ubuntu-latest
163161
strategy:
164162
fail-fast: false
165163
matrix:
166164
node-version: [22, 24]
167-
services:
168-
postgres:
169-
image: postgres:16
170-
env:
171-
POSTGRES_USER: strapi
172-
POSTGRES_PASSWORD: strapi
173-
POSTGRES_DB: strapi_test
174-
ports:
175-
- 5432:5432
176-
options: >-
177-
--health-cmd pg_isready
178-
--health-interval 10s
179-
--health-timeout 5s
180-
--health-retries 5
181-
env:
182-
DATABASE_CLIENT: postgres
183-
DATABASE_HOST: localhost
184-
DATABASE_PORT: 5432
185-
DATABASE_NAME: strapi_test
186-
DATABASE_USERNAME: strapi
187-
DATABASE_PASSWORD: strapi
188165
steps:
189166
- uses: actions/checkout@v4
190167
- name: Install pnpm
@@ -209,38 +186,16 @@ jobs:
209186
apps/*/dist
210187
key: ${{ runner.os }}-node${{ matrix.node-version }}-setup-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'plugins/**', 'apps/**') }}
211188
- name: Run integration tests
212-
run: pnpm run test:integration
189+
run: pnpm run test:integration:postgres
213190

214191
test-integration-mysql:
215192
needs: [setup, lint, typescript]
216-
name: 'test:integration (mysql, node ${{ matrix.node-version }})'
193+
name: 'test:integration:mysql (node ${{ matrix.node-version }})'
217194
runs-on: ubuntu-latest
218195
strategy:
219196
fail-fast: false
220197
matrix:
221198
node-version: [22, 24]
222-
services:
223-
mysql:
224-
image: mysql:8
225-
env:
226-
MYSQL_ROOT_PASSWORD: root
227-
MYSQL_DATABASE: strapi_test
228-
MYSQL_USER: strapi
229-
MYSQL_PASSWORD: strapi
230-
ports:
231-
- 3306:3306
232-
options: >-
233-
--health-cmd "mysqladmin ping -h 127.0.0.1"
234-
--health-interval 10s
235-
--health-timeout 5s
236-
--health-retries 5
237-
env:
238-
DATABASE_CLIENT: mysql
239-
DATABASE_HOST: 127.0.0.1
240-
DATABASE_PORT: 3306
241-
DATABASE_NAME: strapi_test
242-
DATABASE_USERNAME: strapi
243-
DATABASE_PASSWORD: strapi
244199
steps:
245200
- uses: actions/checkout@v4
246201
- name: Install pnpm
@@ -265,18 +220,16 @@ jobs:
265220
apps/*/dist
266221
key: ${{ runner.os }}-node${{ matrix.node-version }}-setup-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'plugins/**', 'apps/**') }}
267222
- name: Run integration tests
268-
run: pnpm run test:integration
223+
run: pnpm run test:integration:mysql
269224

270225
test-e2e-sqlite:
271226
needs: [setup, lint, typescript]
272-
name: 'test:e2e (sqlite, node ${{ matrix.node-version }})'
227+
name: 'test:e2e:sqlite (node ${{ matrix.node-version }})'
273228
runs-on: ubuntu-latest
274229
strategy:
275230
fail-fast: false
276231
matrix:
277232
node-version: [22, 24]
278-
env:
279-
DATABASE_CLIENT: sqlite
280233
steps:
281234
- uses: actions/checkout@v4
282235
- name: Install pnpm
@@ -311,33 +264,12 @@ jobs:
311264

312265
test-e2e-postgres:
313266
needs: [setup, lint, typescript]
314-
name: 'test:e2e (postgres, node ${{ matrix.node-version }})'
267+
name: 'test:e2e:postgres (node ${{ matrix.node-version }})'
315268
runs-on: ubuntu-latest
316269
strategy:
317270
fail-fast: false
318271
matrix:
319272
node-version: [22, 24]
320-
services:
321-
postgres:
322-
image: postgres:16
323-
env:
324-
POSTGRES_USER: strapi
325-
POSTGRES_PASSWORD: strapi
326-
POSTGRES_DB: strapi_test
327-
ports:
328-
- 5432:5432
329-
options: >-
330-
--health-cmd pg_isready
331-
--health-interval 10s
332-
--health-timeout 5s
333-
--health-retries 5
334-
env:
335-
DATABASE_CLIENT: postgres
336-
DATABASE_HOST: localhost
337-
DATABASE_PORT: 5432
338-
DATABASE_NAME: strapi_test
339-
DATABASE_USERNAME: strapi
340-
DATABASE_PASSWORD: strapi
341273
steps:
342274
- uses: actions/checkout@v4
343275
- name: Install pnpm
@@ -362,7 +294,7 @@ jobs:
362294
apps/*/dist
363295
key: ${{ runner.os }}-node${{ matrix.node-version }}-setup-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'plugins/**', 'apps/**') }}
364296
- name: Run e2e tests
365-
run: pnpm run test:e2e
297+
run: pnpm run test:e2e:postgres
366298
- uses: actions/upload-artifact@v4
367299
if: ${{ !cancelled() }}
368300
with:
@@ -372,34 +304,12 @@ jobs:
372304

373305
test-e2e-mysql:
374306
needs: [setup, lint, typescript]
375-
name: 'test:e2e (mysql, node ${{ matrix.node-version }})'
307+
name: 'test:e2e:mysql (node ${{ matrix.node-version }})'
376308
runs-on: ubuntu-latest
377309
strategy:
378310
fail-fast: false
379311
matrix:
380312
node-version: [22, 24]
381-
services:
382-
mysql:
383-
image: mysql:8
384-
env:
385-
MYSQL_ROOT_PASSWORD: root
386-
MYSQL_DATABASE: strapi_test
387-
MYSQL_USER: strapi
388-
MYSQL_PASSWORD: strapi
389-
ports:
390-
- 3306:3306
391-
options: >-
392-
--health-cmd "mysqladmin ping -h 127.0.0.1"
393-
--health-interval 10s
394-
--health-timeout 5s
395-
--health-retries 5
396-
env:
397-
DATABASE_CLIENT: mysql
398-
DATABASE_HOST: 127.0.0.1
399-
DATABASE_PORT: 3306
400-
DATABASE_NAME: strapi_test
401-
DATABASE_USERNAME: strapi
402-
DATABASE_PASSWORD: strapi
403313
steps:
404314
- uses: actions/checkout@v4
405315
- name: Install pnpm
@@ -424,7 +334,7 @@ jobs:
424334
apps/*/dist
425335
key: ${{ runner.os }}-node${{ matrix.node-version }}-setup-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'plugins/**', 'apps/**') }}
426336
- name: Run e2e tests
427-
run: pnpm run test:e2e
337+
run: pnpm run test:e2e:mysql
428338
- uses: actions/upload-artifact@v4
429339
if: ${{ !cancelled() }}
430340
with:
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "ba_invitation",
4+
"info": {
5+
"singularName": "invitation",
6+
"pluralName": "invitations",
7+
"displayName": "Invitations"
8+
},
9+
"options": {
10+
"draftAndPublish": false
11+
},
12+
"pluginOptions": {
13+
"content-manager": {
14+
"visible": false
15+
},
16+
"content-type-builder": {
17+
"visible": false
18+
}
19+
},
20+
"attributes": {
21+
"organizationId": {
22+
"type": "integer",
23+
"configurable": false,
24+
"pluginOptions": {
25+
"better-auth": {
26+
"managed": true
27+
}
28+
},
29+
"required": true
30+
},
31+
"email": {
32+
"type": "email",
33+
"configurable": false,
34+
"pluginOptions": {
35+
"better-auth": {
36+
"managed": true
37+
}
38+
},
39+
"required": true
40+
},
41+
"role": {
42+
"type": "text",
43+
"configurable": false,
44+
"pluginOptions": {
45+
"better-auth": {
46+
"managed": true
47+
}
48+
}
49+
},
50+
"teamId": {
51+
"type": "text",
52+
"configurable": false,
53+
"pluginOptions": {
54+
"better-auth": {
55+
"managed": true
56+
}
57+
}
58+
},
59+
"status": {
60+
"type": "text",
61+
"configurable": false,
62+
"pluginOptions": {
63+
"better-auth": {
64+
"managed": true
65+
}
66+
},
67+
"required": true,
68+
"default": "pending"
69+
},
70+
"expiresAt": {
71+
"type": "datetime",
72+
"configurable": false,
73+
"pluginOptions": {
74+
"better-auth": {
75+
"managed": true
76+
}
77+
},
78+
"required": true
79+
},
80+
"inviterId": {
81+
"type": "integer",
82+
"configurable": false,
83+
"pluginOptions": {
84+
"better-auth": {
85+
"managed": true
86+
}
87+
},
88+
"required": true
89+
}
90+
}
91+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "ba_jwks",
4+
"info": {
5+
"singularName": "jwks",
6+
"pluralName": "jwks",
7+
"displayName": "Jwks"
8+
},
9+
"options": {
10+
"draftAndPublish": false
11+
},
12+
"pluginOptions": {
13+
"content-manager": {
14+
"visible": false
15+
},
16+
"content-type-builder": {
17+
"visible": false
18+
}
19+
},
20+
"attributes": {
21+
"publicKey": {
22+
"type": "text",
23+
"configurable": false,
24+
"pluginOptions": {
25+
"better-auth": {
26+
"managed": true
27+
}
28+
},
29+
"required": true
30+
},
31+
"privateKey": {
32+
"type": "text",
33+
"configurable": false,
34+
"pluginOptions": {
35+
"better-auth": {
36+
"managed": true
37+
}
38+
},
39+
"required": true
40+
},
41+
"expiresAt": {
42+
"type": "datetime",
43+
"configurable": false,
44+
"pluginOptions": {
45+
"better-auth": {
46+
"managed": true
47+
}
48+
}
49+
}
50+
}
51+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "ba_member",
4+
"info": {
5+
"singularName": "member",
6+
"pluralName": "members",
7+
"displayName": "Members"
8+
},
9+
"options": {
10+
"draftAndPublish": false
11+
},
12+
"pluginOptions": {
13+
"content-manager": {
14+
"visible": false
15+
},
16+
"content-type-builder": {
17+
"visible": false
18+
}
19+
},
20+
"attributes": {
21+
"organizationId": {
22+
"type": "integer",
23+
"configurable": false,
24+
"pluginOptions": {
25+
"better-auth": {
26+
"managed": true
27+
}
28+
},
29+
"required": true
30+
},
31+
"userId": {
32+
"type": "integer",
33+
"configurable": false,
34+
"pluginOptions": {
35+
"better-auth": {
36+
"managed": true
37+
}
38+
},
39+
"required": true
40+
},
41+
"role": {
42+
"type": "text",
43+
"configurable": false,
44+
"pluginOptions": {
45+
"better-auth": {
46+
"managed": true
47+
}
48+
},
49+
"required": true,
50+
"default": "member"
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)