スキル一覧に戻る
MemoWikis

reset-dev-database

by MemoWikis

Wikis for Knowledge Management and Learning :book:

13🍴 2📅 2025年12月31日
GitHubで見るManusで実行

SKILL.md


name: reset-dev-database description: Reset the development MySQL database by copying the test scenario SQL dump to the Docker init directory, replacing the database name from memoWikisTest to memoWikis_dev, and reinitializing the MySQL container. Use this skill when the user wants to reset, recreate, or reinitialize the development database.

Reset Development Database

This skill automates the process of resetting the development MySQL database using the test scenario SQL dump.

What this skill does

  1. Copies the SQL dump file: Takes the test scenario dump from src/Tests/TestData/Dumps/memowikis-test-scenario_tiny.sql and copies it to src/Docker/Dev/mysql-init/schema.sql

  2. Replaces the database name: Changes all occurrences of memoWikisTest to memoWikis_dev in the schema file

  3. Reinitializes the MySQL container: Stops the Docker containers, removes the MySQL data directory, and restarts the containers

Step-by-step procedure

Step 1: Copy and transform the SQL file

Read the source SQL file and replace the database name:

# Read the SQL dump file
$sqlContent = Get-Content -Path "src/Tests/TestData/Dumps/memowikis-test-scenario_tiny.sql" -Raw

# Replace database name from memoWikisTest to memoWikis_dev
$sqlContent = $sqlContent -replace 'memoWikisTest', 'memoWikis_dev'

# Write to the Docker init directory
$sqlContent | Set-Content -Path "src/Docker/Dev/mysql-init/schema.sql" -Encoding UTF8

Step 2: Reinitialize the MySQL container

Run the following PowerShell commands from the workspace root:

cd ./src/Docker/Dev; `
docker-compose down; `
Remove-Item -Recurse -Force C:\mysql-data\development; `
docker-compose up -d

Important notes

  • The MySQL data directory C:\mysql-data\development will be completely deleted
  • The MySQL container will automatically execute schema.sql during initialization
  • The database name in the SQL file must match the MYSQL_DATABASE value in the .env file (default: memoWikis_dev)

When to use this skill

  • When you need to reset the development database to a clean state
  • After running the test ScenarioBuilderTests.Deterministic_Tiny_Scenario() to update the schema
  • When the database schema has been updated and you need to apply changes
  • When the development database is corrupted or in an inconsistent state

スコア

総合スコア

55/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

0/5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です