Skip to content

Commit d772be9

Browse files
authored
[SQL storage indexer] Reorder primary key to keep same ordering (#1348)
1 parent 719097d commit d772be9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Breaking changes
1010

1111
### Bugfixes
12+
* Reorder fields in primary key to keep same ordering as before (technical preview). [#1348](https://github.com/elastic/package-registry/pull/1348)
1213

1314
### Added
1415

@@ -28,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2829
### Added
2930
* Add new method `MustParsePackage` to create new packages, running more validations. [#1333](https://github.com/elastic/package-registry/pull/1333)
3031
* Allow to customize settings related to SQL storage indexer (technical preview). [#1334](https://github.com/elastic/package-registry/pull/1334) [#1337](https://github.com/elastic/package-registry/pull/1337)
31-
* Cleanup SQL storage indexer backup database only when a new index version is downloaded (technical preview). [#1337](https://github.com/elastic/package-registry/pull/1337)
32+
* Cleanup SQL storage indexer backup database only when a new index version is downloaded (technical preview). [#1334](https://github.com/elastic/package-registry/pull/1334)
3233
* Add support to discover content packages based on the datasets defined in the discovery parameter. [#1338](https://github.com/elastic/package-registry/pull/1338)
3334
* Include deployment modes in responses when they are defined at inputs of the policy templates. [#1345](https://github.com/elastic/package-registry/pull/1345)
3435

internal/database/sqliterepository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (r *SQLiteRepository) Initialize(ctx context.Context) error {
158158
for _, i := range keys {
159159
createQuery.WriteString(fmt.Sprintf("%s %s, ", i.Name, i.SQLType))
160160
}
161-
createQuery.WriteString("PRIMARY KEY (cursor, name, version));")
161+
createQuery.WriteString("PRIMARY KEY (name, version, cursor));")
162162
if _, err := r.db.ExecContext(ctx, createQuery.String()); err != nil {
163163
return err
164164
}

0 commit comments

Comments
 (0)