New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.0 Beta] Changes not applying to tables when using schemaName #5822
Comments
This might be related to #5473 I am investigating this. |
I think this problem is coming from drizzle-kit. I'm waiting on answers from their team. |
@DanRibbens + users table will be created
+ payload_preferences table will be created
+ payload_preferences_rels table will be created
+ payload_migrations table will be created
--- all table conflicts resolved --- I'm getting the same error: ⨯ Internal error: error: schema "payload" does not exist
at /node_modules/pg-pool/index.js:45:11
... These are the queries I'm passing to be executed in // node_modules/drizzle-kit/payload.js
DrizzleORMPgClient = class extends DrizzleDbClient {
async query(query, values) {
console.log("console.log(query):", query)
const res = await this.db.execute(import_drizzle_orm9.sql.raw(query));
return res.rows;
}
async run(query) {
console.log("I'm not being logged out due to error. :(")
const res = await this.db.execute(import_drizzle_orm9.sql.raw(query));
return res.rows;
}
}; Output: console.log(query): select count(*) as count from "anyTable"
console.log(query): CREATE TABLE IF NOT EXISTS "payload"."users" (
"id" serial PRIMARY KEY NOT NULL,
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
"email" varchar NOT NULL,
"reset_password_token" varchar,
"reset_password_expiration" timestamp(3) with time zone,
"salt" varchar,
"hash" varchar,
"login_attempts" numeric,
"lock_until" timestamp(3) with time zone
);
⨯ Internal error: error: schema "payload" does not exist
at /node_modules/pg-pool/index.js:45:11
... So it looks like Drizzle is pointing to |
Probably not, I have used drizzle and drizzle-kit with non-default schemas (not the |
I can share a few more helpful pieces of information: 1. The migration that is generated does not include a
|
Link to reproduction
No response
Describe the Bug
I encountered a bug using payload-3.0-demo, where upon initializing Payload, a custom schema in my database is not being created. I've implemented it like so:
Here is the error after running simple
pnpm dev
:So I've created a schema with the specified name in my database and tables were properly created within it. I have the impression that this is a workaround for the problem, as when modifying the collection (e.g., changing the slug name in pages collection), I've received a similar error.
slug: "title" -> slug: "page_title"
To Reproduce
schemaName: "payload"
topayload.config.ts
pnpm dev
and go tolocalhost:3000/admin
Payload Version
3.0.0-beta.6
Adapters and Plugins
@payloadcms/db-postgres
The text was updated successfully, but these errors were encountered: