Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/database/incluster/init/02-recreate-gitpod-db.sql
3603 views
1
-- Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
-- Licensed under the GNU Affero General Public License (AGPL). See License.AGPL.txt in the project root for license information.
3
4
-- must be idempotent
5
6
-- @gitpodDB contains name of the DB the script manipulates, and is replaced by the file reader
7
SET
8
@gitpodDB = IFNULL(@gitpodDB, '`__GITPOD_DB_NAME__`');
9
10
SET
11
@statementStr = CONCAT('DROP DATABASE IF EXISTS ', @gitpodDB);
12
PREPARE statement FROM @statementStr;
13
EXECUTE statement;
14
15
SET
16
@statementStr = CONCAT('CREATE DATABASE ', @gitpodDB, ' CHARSET utf8mb4');
17
PREPARE statement FROM @statementStr;
18
EXECUTE statement;
19
20