Skip to content
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

feat: Add core-metadata device/provisionwatcher db methods for postgres #4923

Merged
merged 1 commit into from
Sep 26, 2024
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
12 changes: 12 additions & 0 deletions cmd/core-metadata/res/db/sql/01-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@ CREATE TABLE IF NOT EXISTS core_metadata.device_profile (
id UUID PRIMARY KEY,
content JSONB NOT NULL
);

-- core_metadata.device is used to store the device information
CREATE TABLE IF NOT EXISTS core_metadata.device (
id UUID PRIMARY KEY,
content JSONB NOT NULL
);

-- core_metadata.provision_watcher is used to store the provision watcher information
CREATE TABLE IF NOT EXISTS core_metadata.provision_watcher (
id UUID PRIMARY KEY,
content JSONB NOT NULL
);
2 changes: 1 addition & 1 deletion internal/core/metadata/infrastructure/interfaces/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type DBClient interface {
DeleteDeviceByName(name string) errors.EdgeX
DevicesByServiceName(offset int, limit int, name string) ([]model.Device, errors.EdgeX)
DeviceIdExists(id string) (bool, errors.EdgeX)
DeviceNameExists(id string) (bool, errors.EdgeX)
DeviceNameExists(name string) (bool, errors.EdgeX)
DeviceById(id string) (model.Device, errors.EdgeX)
DeviceByName(name string) (model.Device, errors.EdgeX)
AllDevices(offset int, limit int, labels []string) ([]model.Device, errors.EdgeX)
Expand Down
Loading
Loading