Skip to content

Commit

Permalink
feat(db): update examples in the dashboard (#4698)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuntley authored Jul 8, 2021
1 parent 2ecd842 commit 4f59081
Showing 1 changed file with 45 additions and 0 deletions.
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> {
}

}

0 comments on commit 4f59081

Please sign in to comment.