Skip to content

Commit 00dce60

Browse files
committed
Successful test of migrate-profiles-lake
1 parent 54097e1 commit 00dce60

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/lake.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getActiveProfiles() {
4242
const query = `SELECT contact__wizeos_profile_id, contact__employee_number, contact__email,
4343
contact__first_name, contact__preferred_name, contact__last_name,
4444
contact__photo__url,
45-
contact__is_billable,
45+
contact__isBillable,
4646
contact__location, contact__country,
4747
contact__status, contact__department, contact__business_unit,
4848
contact__employee_status,

app/models/profile.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
PrismaClient,
99
} from "@prisma/client";
1010
import { Prisma } from "@prisma/client";
11-
import { OrderByNode, sql } from "kysely";
11+
import { sql } from "kysely";
1212

1313
interface UserProfile extends Profiles {
1414
role: string;

app/profileMigration.server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { PrismaClient, Prisma } from "@prisma/client";
55
async function getMappedProfiles(): Promise<Prisma.ProfilesCreateInput[]> {
66
const activeProfiles = await getActiveProfiles();
77
const mappedProfiles = activeProfiles.map((lakeProfile) => {
8+
const isBillable = lakeProfile.contact__is_billable === "Billable";
89
return {
910
id: String(lakeProfile.contact__employee_number),
1011
email: lakeProfile.contact__email,
@@ -21,7 +22,7 @@ async function getMappedProfiles(): Promise<Prisma.ProfilesCreateInput[]> {
2122
employeeStatus: lakeProfile.contact__employee_status,
2223
benchStatus: lakeProfile.contact__status,
2324
businessUnit: lakeProfile.contact__business_unit,
24-
isBillable: lakeProfile.contact__is_billable,
25+
isBillable: isBillable,
2526
};
2627
});
2728
return mappedProfiles;

0 commit comments

Comments
 (0)