Skip to content

Commit

Permalink
feat: introduce db-vercel-postgres adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
maneike committed Nov 7, 2024
1 parent 9c27786 commit c16405c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export const preparePayloadConfig = async (configPath: PathLike) => {
// Read the payload.config.ts file
let data = await fs.readFile(configPath, 'utf8');

// Replace postgresAdapter with vercelPostgresAdapter
const oldImport = `import { postgresAdapter } from '@payloadcms/db-postgres'`;
const newImport = `import { vercelPostgresAdapter as postgresAdapter } from '@payloadcms/db-vercel-postgres'`;

data = data.replace(oldImport, newImport);

// Update the db configuration
const dbConfig = `db: postgresAdapter({
schemaName: "payload",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const updatePackages = () => {
});

logWithColoredPrefix('payload', 'Installing necessary packages...');
execSync(`pnpm i pg sharp --reporter silent`, {
execSync(`pnpm i pg sharp @payloadcms/db-vercel-postgres --reporter silent`, {
stdio: 'inherit',
});
};

0 comments on commit c16405c

Please sign in to comment.