-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(db): update examples in the dashboard (#4698)
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
components/gitpod-db/src/typeorm/migration/1625458087438-UpdateExamples.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* 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<any> { | ||
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-- }, | ||
{ 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 | ||
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<any> { | ||
} | ||
|
||
} |