__old_push table

Hi, I just ran a pnpm drizzle-kit push:sqlite to push some schema changes to my turso db. I basically added a single column to a table with a default value. I then removed the column and pushed again. Now I have a new column __old_push and it seems I'm stuck in an intermediate state. Is there a fix for this?
3 Replies
Mykhailo
Mykhailo6mo ago
Hey @wylex Could you show your schema please?
wylex
wylexOP6mo ago
this is the table I modified:
export const unidadPoblacional = sqliteTable("unidad_poblacional", {
upId: text("up_id").primaryKey(),
municipioId: text("municipio_id").references(() => municipio.municipioId),
nombre: text("nombre").notNull(),
poblacion: integer("poblacion").notNull(),
latitude: real("latitude").notNull(),
longitude: real("longitude").notNull(),
});
export const unidadPoblacional = sqliteTable("unidad_poblacional", {
upId: text("up_id").primaryKey(),
municipioId: text("municipio_id").references(() => municipio.municipioId),
nombre: text("nombre").notNull(),
poblacion: integer("poblacion").notNull(),
latitude: real("latitude").notNull(),
longitude: real("longitude").notNull(),
});
As I said, I added a new field slug: text("slug").notNull().default("a") . then I tried to remove the default() and I got a
SQLite error: FOREIGN KEY constraint failed
Then I tried to put it back and execute the push again and started to see the warning:
Warning Found data-loss statements: · You're about to delete __old_push_unidad_poblacional table with 59693 items
Mykhailo
Mykhailo6mo ago
Got it, could you show municipio table please?
Want results from more Discord servers?
Add your server