Skip to content

Commit

Permalink
feat(db-migrations): create migration for new lti integration table
Browse files Browse the repository at this point in the history
  • Loading branch information
hejtful committed Jul 8, 2024
1 parent 64a1ef5 commit f2cba03
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ApiCache, Database, SlackLogger } from './utils'

export async function up(db: Database) {
const apiCache = new ApiCache()
const logger = new SlackLogger('20240708161200-add-table-for-lti-integration')

await db.runSql(`
CREATE TABLE lti_entity (
id BIGINT NOT NULL AUTO_INCREMENT,
resource_link_id VARCHAR(255),
custom_claim_id VARCHAR(255) NOT NULL,
content LONGTEXT,
PRIMARY KEY (id)
)
`)

await db.runSql(`
CREATE INDEX idx_lti_entity_custom_claim_id ON lti_entity (custom_claim_id);
`)

await logger.closeAndSend()
// To reduce the time between deleting the keys and finishing the DB
// transaction, this should be the last command
await apiCache.deleteKeysAndQuit()
}

0 comments on commit f2cba03

Please sign in to comment.