-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: 🔨 Add migration recover script
- Loading branch information
1 parent
c9b3b04
commit d0119ee
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// See https://github.com/baptisteArno/typebot.io/issues/37 | ||
|
||
import { Plan, PrismaClient, WorkspaceRole } from 'db' | ||
import path from 'path' | ||
|
||
const prisma = new PrismaClient() | ||
|
||
export const migrateWorkspace = async () => { | ||
const user = await prisma.user.findFirst() | ||
if (!user) return | ||
console.log('Updating', user.email) | ||
const newWorkspace = await prisma.workspace.create({ | ||
data: { | ||
name: user.name ? `${user.name}'s workspace` : 'My workspace', | ||
members: { create: { userId: user.id, role: WorkspaceRole.ADMIN } }, | ||
plan: Plan.TEAM, | ||
}, | ||
}) | ||
await prisma.credentials.updateMany({ | ||
data: { workspaceId: newWorkspace.id }, | ||
}) | ||
await prisma.customDomain.updateMany({ | ||
data: { workspaceId: newWorkspace.id }, | ||
}) | ||
await prisma.dashboardFolder.updateMany({ | ||
data: { workspaceId: newWorkspace.id }, | ||
}) | ||
await prisma.typebot.updateMany({ | ||
data: { workspaceId: newWorkspace.id }, | ||
}) | ||
} | ||
|
||
require('dotenv').config({ | ||
path: path.join( | ||
__dirname, | ||
process.env.NODE_ENV === 'production' ? '.env.production' : '.env.local' | ||
), | ||
}) | ||
|
||
const main = async () => { | ||
await migrateWorkspace() | ||
} | ||
|
||
main().then() |
d0119ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
yoda.riku.ai
app.yvon.earth
bots.bridge.ai
bergamo.store
bot.joof.it
chat.hayuri.id
bot.tvbeat.it
gollum.riku.ai
talk.gocare.io
bot.jesopizz.it
bot.contakit.com
fitness.riku.ai
zap.fundviser.in
chatbot.matthesv.de
bot.rihabilita.it
bot.danyservice.it
88584434.therpm.club
bot.dsignagency.com
viewer.typebot.io
demo.wemakebots.xyz
bot.barrettamario.it
92109660.therpm.club
hello.advergreen.com
bot.digitalpointer.id
bot.coachayongzul.com
bot.eikju.photography
bot.outstandbrand.com
criar.somaperuzzo.com
bot.ilmuseoaiborghi.it
bot.robertohairlab.it
michaeljackson.riku.ai
bot.pratikmandalia.com
form.bridesquadapp.com
91375310.actualizar.xyz
88152257.actualizar.xyz
87656003.actualizar.xyz
bot.hotelplayarimini.it
arrivalx2.wpwakanda.com
invite.bridesquadapp.com
link.venturasuceder.com
forms.hiabhaykulkarni.com
chat.thehomebuyersusa.com
typebot-viewer.vercel.app
bot.amicidisanfaustino.it
casestudyemb.wpwakanda.com
bot.adventureconsulting.hu
herbalife.barrettamario.it
liveconvert.kandalearn.com
homepageonly.wpwakanda.com
chat.atlasoutfittersk9.com
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
bot.polychromes-project.com
bot.pinpointinteractive.com
bot.seidinembroseanchetu.it
liveconvert2.kandalearn.com
forms.escoladeautomacao.com.br
viewer-v2-typebot-io.vercel.app
bot.seidibergamoseanchetu.it
bot.studiotecnicoimmobiliaremerelli.it
viewer-v2-git-main-typebot-io.vercel.app
d0119ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io
d0119ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2-alpha – ./apps/viewer
apr.nigerias.io
apo.nigerias.io
sat.cr8.ai
chat.sureb4.com
ar.nigerias.io
aso.nigerias.io
bt.id8rs.com
bot.id8rs.com
an.nigerias.io
am.nigerias.io
games.klujo.com
sakuranembro.it
bot.upfunnel.art
faqs.nigerias.io
voicehelp.cr8.ai
zap.techadviser.in
app.chatforms.net
stan.vselise.com
clo.closeer.work
eventhub.com.au
bot.eventhub.com.au
typebot.stillio.com
forms.webisharp.com
bot.ansuraniphone.my
bot.meuesocial.com.br
chat.hayurihijab.com
bot.incusservices.com
c23111azqw.nigerias.io
bot.cotemeuplano.com
gcase.barrettamario.it
83242573.actualizar.xyz
serviziaziendali.online
mainmenu.diddancing.com
brandnewdom.testetstt.com
type.opaulovieira.com.br
aibot.angrybranding.co.uk
piazzatorre.barrettamario.it
boyfriend-breakup.riku.ai
type.talitasouzamarques.com.br
onboarding.libertydreamcare.ie
hunterbot.saleshunter.ai
bookings.littlepartymonkeys.com
personal-trainer.barrettamario.it
studiotecnicoimmobiliaremerelli.it
viewer-v2-alpha-typebot-io.vercel.app
viewer-v2-alpha-git-main-typebot-io.vercel.app
bot.comercializadoraomicron.com
d0119ee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
landing-page-v2 – ./apps/landing-page
landing-page-v2-typebot-io.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
www.get-typebot.com
www.typebot.io
get-typebot.com
typebot.io