Skip to content

Commit

Permalink
Merge pull request juju#17650 from gfouillet/dqlite/machine_reboot/db
Browse files Browse the repository at this point in the history
juju#17650

First step for "Machine Reboots backed with Dqlite" epic.

It just add the required table in the schema.

## Checklist

- [X] Code style: imports ordered, good names, simple structure, etc
- [X] Comments saying why design decisions were made
- [X] Go unit tests, with comments saying what you're testing
- [X] [Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing
- [X] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages

## QA steps

Not required

## Documentation changes

None

## Links

**Jira card:** [JUJU-6303](https://warthogs.atlassian.net/browse/JUJU-6303)



[JUJU-6303]: https://warthogs.atlassian.net/browse/JUJU-6303?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
jujubot authored Jul 5, 2024
2 parents 321f407 + 4ac3d22 commit 9ad5086
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions domain/schema/model/sql/0017-machine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ CREATE TABLE machine_filesystem (
REFERENCES storage_filesystem (uuid),
PRIMARY KEY (machine_uuid, filesystem_uuid)
);

CREATE TABLE machine_requires_reboot (
machine_uuid TEXT NOT NULL PRIMARY KEY,
created_at DATETIME NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW', 'utc')),
CONSTRAINT fk_machine_requires_reboot_machine
FOREIGN KEY (machine_uuid)
REFERENCES machine (uuid)
);
1 change: 1 addition & 0 deletions domain/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ func (s *schemaSuite) TestModelTables(c *gc.C) {
"machine_tool",
"machine_volume",
"machine_filesystem",
"machine_requires_reboot",

// Charm
"charm",
Expand Down

0 comments on commit 9ad5086

Please sign in to comment.