wylex
wylex
DTDrizzle Team
Created by wylex on 7/31/2024 in #help
drizzle-kit migration schema push error
Here's my config file:
export default defineConfig({
schema: "./lib/db/schema.ts",
dialect: "sqlite",
driver: "turso",
dbCredentials: {
url: env.TURSO_DATABASE_URL,
authToken: env.TURSO_AUTH_TOKEN,
}
})
export default defineConfig({
schema: "./lib/db/schema.ts",
dialect: "sqlite",
driver: "turso",
dbCredentials: {
url: env.TURSO_DATABASE_URL,
authToken: env.TURSO_AUTH_TOKEN,
}
})
2 replies
DTDrizzle Team
Created by wylex on 6/14/2024 in #help
__old_push table
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
4 replies