Skip to content

Commit

Permalink
Merge pull request #1899 from balena-io/rollback-nullable-fk-on-dsev
Browse files Browse the repository at this point in the history
Rollback nullable service install FK on device service environment va…
  • Loading branch information
otaviojacobi authored Dec 12, 2024
2 parents 5f9ae52 + 9a86235 commit 62f6968
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
14 changes: 4 additions & 10 deletions src/balena-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,19 +976,13 @@ export interface DeviceServiceEnvironmentVariable {
value: Types['Text']['Read'];
service_install:
| { __id: ServiceInstall['Read']['id'] }
| [ServiceInstall['Read']]
| []
| null;
| [ServiceInstall['Read']];
device__installs__application__has__service_name:
| { __id: ServiceInstall['Read']['id'] }
| [ServiceInstall['Read']]
| []
| null;
| [ServiceInstall['Read']];
device__installs__service:
| { __id: ServiceInstall['Read']['id'] }
| [ServiceInstall['Read']]
| []
| null;
| [ServiceInstall['Read']];
application__has__service_name:
| { __id: Service['Read']['id'] }
| [Service['Read']];
Expand All @@ -1001,7 +995,7 @@ export interface DeviceServiceEnvironmentVariable {
name: Types['Short Text']['Write'];
id: Types['Serial']['Write'];
value: Types['Text']['Write'];
service_install: ServiceInstall['Write']['id'] | null;
service_install: ServiceInstall['Write']['id'];
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/balena.sbvr
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Fact type: image environment variable has value
Fact type: device service environment variable has value
Necessity: each device service environment variable has exactly one value.
Fact type: device service environment variable has service install
Necessity: each device service environment variable has at most one service install.
Necessity: each device service environment variable has exactly one service install.


-- application tag
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "device service environment variable"
ALTER COLUMN "service install" SET NOT NULL;

0 comments on commit 62f6968

Please sign in to comment.