Skip to content

Commit

Permalink
chore: 🤖 add seed dev user account
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpetrov committed Oct 13, 2023
1 parent 973a82a commit 44d1fb6
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions packages/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,70 @@ async function main() {
})
)
);

const userId = 'clnol0gtc000208jlgp3p83av';
const freeOrgId = 'clnokxi0p000008jlaxe24av9';
const premiumOrgId = 'clnol6ij8000308jl1cky5hsy';
const subscriptionId = 'clnolau4y000408jl08aqektv';

await prisma.user.upsert({
where: {
id: userId,
},
create: {
id: userId,
emailVerified: new Date(),
email: 'dev@chaindesk.ai',
memberships: {
create: [
{
role: 'OWNER',
organization: {
create: {
id: freeOrgId,
name: 'free',
apiKeys: {
create: {
key: '46e98f6d-edf6-4545-9f87-80d81fb24771',
},
},
usage: {
create: {},
},
},
},
},
{
role: 'OWNER',
organization: {
create: {
id: premiumOrgId,
name: 'premium',
apiKeys: {
create: {
key: 'f7d3174f-4335-4a2b-bb02-416453ea2099',
},
},
usage: {
create: {},
},
subscriptions: {
create: {
id: subscriptionId,
status: 'active',
plan: 'level_3',
customerId: '42',
priceId: prices?.data?.[0]?.id,
},
},
},
},
},
],
},
},
update: {},
});
} catch (err) {
console.log('prisma seed err', err);
throw err;
Expand Down

1 comment on commit 44d1fb6

@vercel
Copy link

@vercel vercel bot commented on 44d1fb6 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.