Aliy Akhbar
Aliy Akhbar
DTDrizzle Team
Created by Aliy Akhbar on 5/23/2024 in #help
drizzle-kit push not updating table schem
import { sql } from "drizzle-orm";
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";

export const newsTable = sqliteTable("news", {
id: integer("id").primaryKey(),
title: text("title").notNull(),
content: text("content").notNull(),
description: text("description"),
published: text("published").notNull().default("unpublished"), // e.g., 'published', 'unpublished'
image_url: text("image_url"),
testing: text("testing"),
created_at: text("created_at").default(sql`CURRENT_TIMESTAMP`),
updated_at: text("updated_at").default(sql`CURRENT_TIMESTAMP`),
});

export type News = typeof newsTable.$inferSelect;
import { sql } from "drizzle-orm";
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";

export const newsTable = sqliteTable("news", {
id: integer("id").primaryKey(),
title: text("title").notNull(),
content: text("content").notNull(),
description: text("description"),
published: text("published").notNull().default("unpublished"), // e.g., 'published', 'unpublished'
image_url: text("image_url"),
testing: text("testing"),
created_at: text("created_at").default(sql`CURRENT_TIMESTAMP`),
updated_at: text("updated_at").default(sql`CURRENT_TIMESTAMP`),
});

export type News = typeof newsTable.$inferSelect;
for example i have
testing: text("testing"),
testing: text("testing"),
when i generate and push, then the column is created but if i comment the testing and then try to generate and push, the column is still there. running on
drizzle-kit: v0.21.4
drizzle-orm: v0.30.10
drizzle-kit: v0.21.4
drizzle-orm: v0.30.10
things use to work before 21.2 now things seem buggy
5 replies