The tablesFilter option doesn't work

No matter what I try I cannot get the tablesFilter option to work. It always migrates all tables regardless of if I am using
push
or
generate


package.json

{
  "name": "bundrizzle",
  "module": "index.ts",
  "type": "module",
  "devDependencies": {
    "@types/better-sqlite3": "^7.6.11",
    "@types/bun": "^1.1.12",
    "drizzle-kit": "^0.28.1"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "better-sqlite3": "^11.5.0",
    "drizzle-orm": "^0.36.0"
  }
}


schema.ts:

import { relations } from "drizzle-orm";
import { int, sqliteTable, text } from "drizzle-orm/sqlite-core";

export const user = sqliteTable("users_table", {
    userId: int().primaryKey({ autoIncrement: true }),
    name: text().notNull(),
    age: int().notNull(),
    email: text().notNull().unique(),
});

export const post = sqliteTable("posts_table", {
    id: int().primaryKey({ autoIncrement: true }),
    userId: int().notNull(),
    title: text().notNull(),
    content: text().notNull(),
});

export const postRelations = relations(post, ({ one }) => ({
    user: one(user, {
        fields: [post.userId],
        references: [user.userId],
    }),
}));


drizzle.config.ts

import { defineConfig } from "drizzle-kit";

export default defineConfig({
    out: "./drizzle",
    schema: "schema.ts",
    dialect: "sqlite",
    tablesFilter: ["users_table"],
    dbCredentials: {
        url: "test.db",
    },
});
Was this page helpful?