Drizzle spontaneously trying to truncate my db

Nnr77514/1/2024
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!
Jjaronheard4/1/2024
This also happened to me this morning with my PlanetScale database... almost giving me a heart attack!
Jjaronheard4/1/2024
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
BByteBender4/1/2024
same
BByteBender4/1/2024
No description
BByteBender4/1/2024
i Just got here to report this whats going on???? april fools oooooooo I am safe
Nnr77514/1/2024
@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?
Nnr77514/1/2024
Some master trolling going on, then!
ASAndrii Sherman4/1/2024
Sorry everyone :tired: But if you do something, you should be the best in it It goes for April 1st as well
Aalfonsocartes4/1/2024
:sweating:
No description
ASAndrii Sherman4/1/2024
:nomore: The day we decided to lose all the users
Xxeon064/1/2024
Yikes
BByteBender4/2/2024
there was my 132211 rows of stock table worth millions, thanks for the heart attack

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended 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`drizzle-kit generate:sqlite` doesn't work`lib/drizzle.ts` ```ts import { text, blob, sqliteTable } from "drizzle-orm/sqlite-core"; export coStudio not enough info to infer relationI'm getting this error: ``` throw new Error( ^ Error: There is not enough information toTurso DB reads (alot)Using turso for a project with drizzle ( I usually use mysql ), and i'm getting way more database reAppending to array OnConflictUpdate()? (Postgres)**full question on stack overflow: **https://stackoverflow.com/questions/78246191/error-appending-toTypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')I'm getting this error when I want to rename a table (there are no other changes). Old table: ``` ebetter way to check truthy / falsey from selectHey all, currently checking if the length > 0 and <1 to check truthy / falsey is there a better way Relation join conditionsHey - let's say I have the following SQL: ```sql SELECT blocks.id, blocks.type FROM inHow do I use the sql operator with better-sqlite3?Hello. I'm trying to build a custom query with the sql operator in drizzle-orm, and to run it againsIs there a way in drizzle to return the count before limit and offset?i have a table that i need to limit and offset that also needs to return the count. is there a way torder by dynamic columi have a table and i want the user to be able to order by different columns. how do i write the driz