Hi all! Noob question here. Given that: 1. I hav...
# orm-help
m
Hi all! Noob question here. Given that: 1. I have a basic Prisma schema for users and auth with database in place 2. I want to import completely unrelated data to my database (sports data) Can I import data to my existing prisma managed database and use
prisma db pull
to automatically update schema with the imported data tables? đŸ€”
✅ 1
t
https://www.prisma.io/docs/reference/api-reference/command-reference#db-pull If I were you,
prisma db pull --print
to old db and copy needed part of scheme and paste schema.prisma file and run
prisma migrate dev
. New tables is created, restore data in any way. e.g. 1. use db dump and restore tool like pg_dump and psql when using postgreSQL. 2. Export old data csv, json etc. Then write and run script using sql or prisma orm to import.
r
That's idea behind db pull and the introspection process. you can find more info here: https://www.prisma.io/docs/concepts/components/introspection
r
Hi @Marek BrzeziƄski 👋 You can import completely unrelated data to your database. Prisma
db pull
will introspect the database and add it to your schema file as Ran has pointed out.
m
ok, perfect 👌 thank you for the quick answer 🙏 I need to go through the prisma docs more deeply - they are fantastic! One of the best documentations I've seen in a while
💚 1
prisma rainbow 1
v
Aw thank you Marek! That's awesome to hear you're finding our Docs helpful! 😊 💯