@vrplatform/kysely 1.3.45-stage.4411 → 1.3.45-stage.4414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import type { Kysely } from 'kysely';
|
|
2
|
-
import { sql } from 'kysely';
|
|
3
2
|
|
|
4
|
-
// CUS-2503:
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// CUS-2503: retained as a no-op because this migration name reached staging.
|
|
4
|
+
// Feature evaluation belongs in /me and must not manufacture team enablements
|
|
5
|
+
// from user approvals. Keeping the file lets environments with an existing
|
|
6
|
+
// migration-ledger entry continue to migrate safely.
|
|
8
7
|
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
9
|
-
|
|
10
|
-
insert into public.feature_enabled_team (tenant_id, feature_id, status)
|
|
11
|
-
select tenant.id, approved_feature.id, 'partially'
|
|
12
|
-
from public.tenant as tenant
|
|
13
|
-
join (
|
|
14
|
-
select distinct feature.id, feature.tenant_id
|
|
15
|
-
from public.feature as feature
|
|
16
|
-
inner join public.feature_approval as approval
|
|
17
|
-
on approval.feature_id = feature.id
|
|
18
|
-
where approval.status in ('partially', 'all')
|
|
19
|
-
) as approved_feature
|
|
20
|
-
on approved_feature.tenant_id is null
|
|
21
|
-
or approved_feature.tenant_id = tenant.id
|
|
22
|
-
where tenant.status = 'active'
|
|
23
|
-
on conflict (tenant_id, feature_id) do nothing;
|
|
24
|
-
`.execute(db);
|
|
8
|
+
void db;
|
|
25
9
|
}
|
|
26
10
|
|
|
27
|
-
export async function down(): Promise<void> {
|
|
28
|
-
|
|
29
|
-
// be distinguished from partial enablements created after this migration.
|
|
11
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
12
|
+
void db;
|
|
30
13
|
}
|