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

Fix incorrect liquibase references to instance_id #1286

Merged
merged 1 commit into from Aug 1, 2022

Conversation

kahowell
Copy link
Contributor

@kahowell kahowell commented Aug 1, 2022

Confusingly, we have a column named instance_id on the hosts table;
we also have a column named instance_id on instance_measurements.
However, the instance_id on instance_measurements references
hosts.id and NOT hosts.instance_id.

Testing

Try the following sql for testing the trigger change:

insert into account_services(account_number, service_type) values ('a123', 'HBI_HOST');
insert into hosts(id, instance_id, display_name, account_number, org_id, cores, sockets)
values ('0cfbdd0e-8f5d-4152-9945-f8fd452c2b2d', 'foobar', 'foo', 'a123', 'org123', 4, null);
select * from instance_measurements;

The original testing instructions used the same value for both id and
instance_id, which is possibly why this wasn't caught sooner.

Note that given the changesets involved were modified, I added
runOnChange=true to simplify re-running against deployments where it's
already run.

Confusingly, we have a column named `instance_id` on the `hosts` table;
we also have a column named `instance_id` on `instance_measurements`.
However, the `instance_id` on `instance_measurements` references
`hosts.id` and NOT `hosts.instance_id`.

Testing
-------

Try the following sql for testing the trigger change:

```sql
insert into account_services(account_number, service_type) values ('a123', 'HBI_HOST');
insert into hosts(id, instance_id, display_name, account_number, org_id, cores, sockets)
values ('0cfbdd0e-8f5d-4152-9945-f8fd452c2b2d', 'foobar', 'foo', 'a123', 'org123', 4, null);
select * from instance_measurements;
```

The original testing instructions used the same value for both `id` and
`instance_id`, which is possibly why this wasn't caught sooner.

Note that given the changesets involved were modified, I added
`runOnChange=true` to simplify re-running against deployments where it's
already run.
@kahowell kahowell merged commit 51fed69 into develop Aug 1, 2022
@kahowell kahowell deleted the khowell/swatch-liquibase-regression branch August 1, 2022 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants