File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
apps/webapp/app/v3/services Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,20 @@ export class InitializeDeploymentService extends BaseService {
18
18
payload : InitializeDeploymentRequestBody
19
19
) {
20
20
return this . traceWithEnv ( "call" , environment , async ( span ) => {
21
- if ( payload . type !== "V1" && environment . project . engine !== "V2" ) {
22
- throw new ServiceValidationError ( "Only V1 deployments are supported for this project" ) ;
21
+ if ( payload . type === "UNMANAGED" ) {
22
+ throw new ServiceValidationError ( "UNMANAGED deployments are not supported" ) ;
23
+ }
24
+
25
+ // Upgrade the project to engine "V2" if it's not already. This should cover cases where people deploy to V2 without running dev first.
26
+ if ( payload . type === "MANAGED" && environment . project . engine === "V1" ) {
27
+ await this . _prisma . project . update ( {
28
+ where : {
29
+ id : environment . project . id ,
30
+ } ,
31
+ data : {
32
+ engine : "V2" ,
33
+ } ,
34
+ } ) ;
23
35
}
24
36
25
37
const latestDeployment = await this . _prisma . workerDeployment . findFirst ( {
You can’t perform that action at this time.
0 commit comments