Skip to content

Commit

Permalink
docs(deployment): update db for devicestate (#345)
Browse files Browse the repository at this point in the history
* docs(deployment): update db

* fix: mkdocs deprec warnings
bwendlandt-intel authored Oct 25, 2023
1 parent 04aabc6 commit 1c4526a
Showing 3 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/Deployment/Database/schema.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ The diagrams below illustrates the database schema and relationships for MPS and
string tenantid
string friendlyname
string dnssuffix
json deviceInfo
}
```

42 changes: 41 additions & 1 deletion docs/Deployment/upgradeVersion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@

## Specific Changes Required for Version Upgrades

### Upgrade to 2.16 (Oct 23) from 2.15 (Sep 23)

The 2.16 release of Open AMT requires an upgrade to the `mpsdb` database. More information about why we've made this change can be found in the [October 2023 Release Notes](https://open-amt-cloud-toolkit.github.io/docs/2.16/release-notes/#whats-new).

1. Run the following SQL script to alter constraints before upgrading the services.

``` sql
ALTER TABLE devices
ADD COLUMN IF NOT EXISTS deviceInfo json
```

???+ example "Example - Adding Columns to PostgresDB using psql"
This example walks through one potential option to update a Postgres Database using psql.

1. Open a Command Prompt or Terminal.

2. Connect to your Postgres instance and `mpsdb` database. Provide the hostname of the database, the port (Postgres default is 5432), the database `mpsdb`, and your database user.
```
psql -h [HOSTNAME] -p 5432 -d mpsdb -U [DATABASE USER]
```

??? example "Example Commands"
```
Azure:
psql -h myazuredb-sql.postgres.database.azure.com -p 5432 -d mpsdb -U postgresadmin@myazuredb-sql

AWS:
psql -h myawsdb-1.jotd7t2abapq.us-west-2.rds.amazonaws.com -p 5432 -d mpsdb -U postgresadmin
```

3. Provide your Postgres user password.

4. Run the SQL Statements.

5. Verify the constraints were modified correctly.
``` sql
SELECT * FROM devices;
```

2. Continue with [Upgrade a Minor Version](#upgrade-a-minor-version-ie-2x-to-2y) steps below.

### Upgrade to 2.15 (Sep 23) from 2.14 (Aug 23)

@@ -18,7 +58,7 @@ The 2.15 release of Open AMT requires an upgrade to the `rpsdb` database. More i
ADD PRIMARY KEY (name, domain_suffix, tenant_id);
```
???+ example "Example - Adding Columns to PostgresDB using psql"
??? example "Example - Adding Columns to PostgresDB using psql"
This example walks through one potential option to update a Postgres Database using psql.
1. Open a Command Prompt or Terminal.
3 changes: 0 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -165,9 +165,6 @@ markdown_extensions:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- toc:
permalink: true
extra_css:

0 comments on commit 1c4526a

Please sign in to comment.