Running multiple projects from one database (Drizzle)

I'm pretty new to backend concepts and drizzle. I have created one project already using T3 stack + drizzle and have the database on Supabase. It's deployed and working as expected but I am now looking at starting another project. I am aware that the following bit of table creation code effectively allows me to run multiple projects on one database as all tables for that project are prefixed:
export const createTable = pgTableCreator((name) => `someProjectName_${name}`);
export const createTable = pgTableCreator((name) => `someProjectName_${name}`);
My main concern would be inadvertently wiping all the data on my previous project. Is this likely to happen or are there some protections in place to prevent me doing something stupid? If it makes any difference to the answer, I am using/generating migrations for my previous project and intend to do the same with my new project. I notice that by default the migration history goes to a shared table. There is an option to configure it so that it goes to a different table. Is this necessary or can migrations for 2 different projects live happily in the same table?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?