Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): update examples in the dashboard #4698

Merged
merged 2 commits into from
Jul 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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> {
}

}