patch: Add Continued MySQL Support
Expanded packages/backend-common with MySQL Tests Updated packages/backend-tasks column types to conform to MySQL Updated packages/backend-tasks database tests with MySQL Updated packages/backend-tasks datetime column to work with MySQL Updated packages/create-app with a production MySQL App Config template Updated packages/e2e-test to allow for e2e testing with MySQL Updated plugins/app-backend some text columns to string Updated plugins/app-backend interval to work with MySQL Updated plugins/bazaar-backend to run db tests against MySQL Updated plugins/catalog-backend-module-incremental-ingestion to run db tests against MySQL Updated plugins/catalog-backend text columns to longtext to work with MySQL like issue suggested Updated plugins/code-coverage-backend text column to string Updated plugins/linguist-backend text column to string Updated plugins/tech-insights-backend text columns to string Updated plugins/tech-insights-backend db tests to include MySQL Added New E2E tests to run on pull requests to test against MySQL Co-authored-by: Alex Rocha <alexr1@vmware.com> Co-authored-by: David Alvarado <dalvarado@vmware.com> Co-authored-by: Shwetha Gururaj <gururajsh@vmware.com> Co-authored-by: Al <aberezovsky@vmware.com> Co-authored-by: Gerg <gcobb@vmware.com> Signed-off-by: Pete Levine A <lpete@vmware.com> Signed-off-by: lpete@vmware.com <lpete@vmware.com>
This commit is contained in:
committed by
lpete@vmware.com
parent
47782f4bfa
commit
cfc3ca6ce0
@@ -37,7 +37,7 @@ jest.setTimeout(60_000);
|
||||
|
||||
describe('StaticAssetsStore', () => {
|
||||
const databases = TestDatabases.create({
|
||||
ids: ['POSTGRES_13', 'POSTGRES_9', 'SQLITE_3'],
|
||||
ids: ['MYSQL_8', 'POSTGRES_13', 'POSTGRES_9', 'SQLITE_3'],
|
||||
});
|
||||
|
||||
it.each(databases.eachSupportedId())(
|
||||
@@ -160,7 +160,11 @@ describe('StaticAssetsStore', () => {
|
||||
.update({
|
||||
last_modified_at: knex.client.config.client.includes('sqlite3')
|
||||
? knex.raw(`datetime('now', '-3600 seconds')`)
|
||||
: knex.raw(`now() + interval '-3600 seconds'`),
|
||||
: (
|
||||
knex.client.config.client.includes('mysql')
|
||||
? knex.raw(`date_sub(now(), interval 3600 second)`)
|
||||
: knex.raw(`now() + interval '-3600 seconds'`)
|
||||
),
|
||||
});
|
||||
expect(updated).toBe(1);
|
||||
|
||||
|
||||
@@ -144,7 +144,10 @@ export class StaticAssetsStore implements StaticAssetProvider {
|
||||
'<=',
|
||||
this.#db.client.config.client.includes('sqlite3')
|
||||
? this.#db.raw(`datetime('now', ?)`, [`-${maxAgeSeconds} seconds`])
|
||||
: this.#db.raw(`now() + interval '${-maxAgeSeconds} seconds'`),
|
||||
: (this.#db.client.config.client.includes('mysql')
|
||||
? this.#db.raw(`date_sub(now(), interval ${maxAgeSeconds} second)`)
|
||||
: this.#db.raw(`now() + interval '${-maxAgeSeconds} seconds'`)
|
||||
),
|
||||
)
|
||||
.delete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user