From dc8d1e581369ed08bf0675f8520c7b26cdb97265 Mon Sep 17 00:00:00 2001 From: Mike Nikles Date: Mon, 7 Jun 2021 18:02:06 +0000 Subject: [PATCH] Align the examples with the quickstarts in the docs. --- ...3088592648-AlignExamplesWithQuickstarts.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 components/gitpod-db/src/typeorm/migration/1623088592648-AlignExamplesWithQuickstarts.ts diff --git a/components/gitpod-db/src/typeorm/migration/1623088592648-AlignExamplesWithQuickstarts.ts b/components/gitpod-db/src/typeorm/migration/1623088592648-AlignExamplesWithQuickstarts.ts new file mode 100644 index 00000000000000..21b9fe4616b1e0 --- /dev/null +++ b/components/gitpod-db/src/typeorm/migration/1623088592648-AlignExamplesWithQuickstarts.ts @@ -0,0 +1,26 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class AlignExamplesWithQuickstarts1623088592648 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + const newEntries = [ + { url: 'https://github.com/gitpod-io/example-typescript-node', description: 'A project template for Node.js or TypeScript applications', priority: 90 }, + { url: 'https://github.com/gitpod-io/example-golang-cli', description: 'A project template for Go applications', priority: 80 }, + { url: 'https://github.com/gitpod-io/example-rust-cli', description: 'A project template for Rust applications', priority: 70 }, + { url: 'https://github.com/gitpod-io/spring-petclinic', description: 'A project template for Java applications', priority: 60 }, + { url: 'https://github.com/gitpod-io/sveltejs-template', description: 'A project template for Svelte applications', priority: 50 }, + ] + // delete old entries + await queryRunner.query("DELETE FROM d_b_repository_white_list"); + const insert = `INSERT IGNORE INTO d_b_repository_white_list (url, description, priority) VALUES ${newEntries.map(e=>'(?, ?, ?)').join(', ')}`; + const values: any[] = []; + for (const e of newEntries) { + values.push(e.url, e.description, e.priority); + } + await queryRunner.query(insert, values); + } + + public async down(queryRunner: QueryRunner): Promise { + } + +}