Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ export default class DataSourceValidator implements AstValidator<DataSource> {
private validateUrl(ds: DataSource, accept: ValidationAcceptor) {
const url = ds.fields.find((f) => f.name === 'url');
if (!url) {
accept('error', 'datasource must include a "url" field', {
node: ds,
});
// url field is optional for new versions of Prisma
return;
}

for (const fieldName of ['url', 'shadowDatabaseUrl']) {
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/tests/generator/prisma-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Prisma generator test', () => {
process.chdir(r.name);

execSync('npm init -y', { stdio: 'ignore' });
execSync('npm install prisma');
execSync('npm install prisma@6.19.x');
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ describe('Datasource Validation Tests', () => {
expect(result).toMatchObject({
status: 'rejected',
reason: {
cause: [
{ message: 'datasource must include a "provider" field' },
{ message: 'datasource must include a "url" field' },
],
cause: [{ message: 'datasource must include a "provider" field' }],
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/cli/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ model Post {
// set up project
fs.writeFileSync('package.json', JSON.stringify({ name: 'my app', version: '1.0.0' }));
createNpmrc();
installPackage('prisma @prisma/client zod@^3.25.0 @types/node@20');
installPackage('prisma@6.19.x @prisma/client@6.19.x zod@^3.25.0 @types/node@20');
installPackage(path.join(__dirname, '../../../../packages/runtime/dist'));

// set up schema
Expand Down
Loading