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,
},
});
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;
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;
1 Reply
kostas
kostas7mo ago
Hi, Xata's Postgres-enabled databases are still in Beta and certain areas are still under active development. Drizzle migrations fall in this category for the time being. They make use of multiple schemas, while Xata allows using a single schema right now. The Xata dev team is already working on multiple schemas support which will be available relatively soon and will resolve this issue. Until then, you can use drizzle-kit push and introspect to update or retrieve the database schema.
Want results from more Discord servers?
Add your server