mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
19 lines
627 B
SQL
19 lines
627 B
SQL
-- Copyright (c) 2020 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.
|
|
|
|
-- must be idempotent
|
|
|
|
-- @gitpodDB contains name of the DB the script manipulates, and is replaced by the file reader
|
|
SET
|
|
@gitpodDB = IFNULL(@gitpodDB, '`__GITPOD_DB_NAME__`');
|
|
|
|
SET
|
|
@statementStr = CONCAT('DROP DATABASE IF EXISTS ', @gitpodDB);
|
|
PREPARE statement FROM @statementStr;
|
|
EXECUTE statement;
|
|
|
|
SET
|
|
@statementStr = CONCAT('CREATE DATABASE ', @gitpodDB, ' CHARSET utf8mb4');
|
|
PREPARE statement FROM @statementStr;
|
|
EXECUTE statement;
|