Drizzle spontaneously trying to truncate my db

Today I opened up Drizzle Studio, connected to my Vercel Postgres database, and a modal popped up saying: 'Database truncation Deleting 57 rows from 17 tables.' Now, I do have 17 tables and 57 entries but did not ask for anything to be truncated or deleted. This is completely spontaneous and extremely undesired. What sparked this action? Is there a setting on my Vercel Database or in Drizzle config I should be aware of? I certainly don't want Drizzle spontaneously clearing out my Database. Any help would be extremely appreciated. Thanks in advance!
13 Replies
jaronheard
jaronheard4mo ago
This also happened to me this morning with my PlanetScale database... almost giving me a heart attack!
jaronheard
jaronheard4mo ago
to add in some details on what i did in case it's helpful: - i had just switched database branches by adjusting my DATABASE_URL environment variable, and there is a difference in the schema between those two branches, so it's possible that drizzle studio thought i was doing a migration? - i believe i was able to cancel the truncation before it completed, but this was the dialog box that was spontaneously shown
No description
ByteBender
ByteBender4mo ago
same
ByteBender
ByteBender4mo ago
No description
ByteBender
ByteBender4mo ago
i Just got here to report this whats going on???? april fools oooooooo I am safe
nr7751
nr77514mo ago
@jaronheard, Yes, I did the same thing, and I managed to abort it. In my case, I hadn't changed anything. Yesterday, I had made some very minor changes to the tables, so minor that they didn't even qualify as a migration. Today, when I logged into Studio, I was greeted with that same modal. I need an answer, lest this happens again. @ByteBender , Arpil Fool's ?! Any official word on the matter?
nr7751
nr77514mo ago
Some master trolling going on, then!
Andrii Sherman
Andrii Sherman4mo ago
Sorry everyone :tired: But if you do something, you should be the best in it It goes for April 1st as well
alfonsocartes
alfonsocartes4mo ago
:sweating:
No description
Andrii Sherman
Andrii Sherman4mo ago
:nomore: The day we decided to lose all the users
xeon06
xeon064mo ago
Yikes
ByteBender
ByteBender4mo ago
there was my 132211 rows of stock table worth millions, thanks for the heart attack
Want results from more Discord servers?
Add your server
More Posts
string arrayHow are string arrays defined in drizzle? It always seems to revert back to json/jsonb when definingdates in sqlite not being evaluated, causing "Invalid Date"``` expiresAt: int("expires_at", { mode: "timestamp" }) .notNull() .$defaultFn(() =>drizzle-kit generate migration for pg is stuck at: Reading config file 'drizzle.config.ts'Hello, im using Deno 1.41.3. After executing `deno run -A npm:drizzle-kit generate:pg` cli just showHow do I reuse the results from the where clause within the findMany?I have a vendor ID and want to retrieve all restaurant IDs and menu IDs associated with that vendor.drizzle kit generate schemas for mysql had a little type mismatched problem.Has anyone encountered a similar problem of mismatched types with the error message "MySqlVarCharBuiHow to make a text based timestamp type for sqlite with zod schema inferenceWhen I use the built in integer with mode timestamp, the generated zod schemas correctly declare thaWhat's the best way to query my db?I'm running Supabase Postgres locally with Drizzle. In production, I'd use the connection pooler wHow to query many-many with mysqlI setup a simple example to test if many-many query and ran again into the same issue. ```ts Error:How do I access config in fromDriver and toDriver when defining a custom type using customType?None of the examples do this so it's not clear how/if this is possible?Cannot get user roleI'm using Next.js with next auth and the drizzle adapter. I must be doing something wrong because th