Can't migrate to Xata, error: schema "drizzle" does not exist

Maybe a bug? Work fine with Neon but not Xata,
Studio and Push command work great but with migrate I got error: schema "drizzle" does not exist
here is my configuration
import { defineConfig } from "drizzle-kit";
import { getXataClient } from "./src/xata"; 
const xata = getXataClient();
export default defineConfig({
  dialect: "postgresql", 
  schema: "./src/schema.ts",
  out: "./drizzle",
  dbCredentials: {
    url: xata.sql.connectionString,
  },
});

my schema
import { integer, pgTable, serial, text, timestamp } from "drizzle-orm/pg-core";

export const usersTable = pgTable("users_table", {
  id: serial("id").primaryKey(),
  name: text("name").notNull(),
  age: integer("age").notNull(),
  email: text("email").notNull().unique(),
});

export const postsTable = pgTable("posts_table", {
  id: serial("id").primaryKey(),
  title: text("title").notNull(),
  content: text("content").notNull(),
  userId: integer("user_id")
    .notNull()
    .references(() => usersTable.id, { onDelete: "cascade" }),
  createdAt: timestamp("created_at").notNull().defaultNow(),
  updatedAt: timestamp("updated_at")
    .notNull()
    .$onUpdate(() => new Date()),
});

export type InsertUser = typeof usersTable.$inferInsert;
export type SelectUser = typeof usersTable.$inferSelect;

export type InsertPost = typeof postsTable.$inferInsert;
export type SelectPost = typeof postsTable.$inferSelect;
Was this page helpful?