From cce0bda1bf61c7e4f36b4dfd3139f8355dae046b Mon Sep 17 00:00:00 2001 From: Geoffrey Huntley Date: Mon, 5 Jul 2021 04:10:43 +0000 Subject: [PATCH 1/2] feat(db): update examples in the dashboard --- .../migration/1625458087438-UpdateExamples.ts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts diff --git a/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts b/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts new file mode 100644 index 00000000000000..94c4dd2e9e4496 --- /dev/null +++ b/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2021 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License-AGPL.txt in the project root for license information. + */ + +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class UpdateExamples1625458087438 implements MigrationInterface { + +public async up(queryRunner: QueryRunner): Promise { + let priority = 90; + const newEntries = [ + { url: 'https://github.com/gitpod-io/template-typescript-node', description: 'A Node.js app, written in TypeScript.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-typescript-react', description: 'A create-react-app template, written in TypeScript.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-python-django', description: 'A Django app template. ', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-python-flask', description: 'A Flasker app template.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/spring-petclinic', description: 'A Spring app written in Java.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-php-drupal-ddev', description: 'A Drupal app template, scaffolded by DDEV.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-php-laravel-mysql', description: 'A Laravel app template, with MySQL.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-ruby-on-rails', description: 'A Ruby on Rails app template, with Postgres. ', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-golang-cli', description: 'A CLI template, written in Go.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-rust-cli', description: 'A CLI template, written in Rust.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-dotnet-core-cli-csharp', description: 'A CLI starter for .NET written in C#.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-sveltejs', description: 'A Svelte.js app writtten in JavaScript.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-sveltejskit', description: 'A SvelteKit app template.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-datasette', description: 'A Datasette template.', priority: priority-- }, + + ] + // 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 { + } + +} From 82d88ad90b58e6887717a2c64b0d4ca6a6533711 Mon Sep 17 00:00:00 2001 From: Geoffrey Huntley Date: Tue, 6 Jul 2021 10:28:14 +0000 Subject: [PATCH 2/2] feat(db): add nix and haskell template --- .../src/typeorm/migration/1625458087438-UpdateExamples.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts b/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts index 94c4dd2e9e4496..7d35d02b32adfb 100644 --- a/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts +++ b/components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts @@ -25,6 +25,8 @@ public async up(queryRunner: QueryRunner): Promise { { url: 'https://github.com/gitpod-io/template-sveltejs', description: 'A Svelte.js app writtten in JavaScript.', priority: priority-- }, { url: 'https://github.com/gitpod-io/template-sveltejskit', description: 'A SvelteKit app template.', priority: priority-- }, { url: 'https://github.com/gitpod-io/template-datasette', description: 'A Datasette template.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-nix', description: 'A nix template for reproducible development environments.', priority: priority-- }, + { url: 'https://github.com/gitpod-io/template-haskell', description: 'A Haskell template.', priority: priority-- }, ] // delete old entries