All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 54s
- Changed file permissions from 644 to 755 for various files in the mobile-app and mobile-app_legacy_rn_expo directories, ensuring executable permissions where necessary. - Added a new SQL migration script to the backend to introduce missing columns for club billing and invoice settings in the clubs table, maintaining synchronization with the current Sequelize model.
101 lines
3.5 KiB
SQL
Executable File
101 lines
3.5 KiB
SQL
Executable File
-- Finales Cleanup-Script für die verbleibenden Problem-Tabellen
|
|
-- Entfernt weitere INDEX aus member, diary_tags und season
|
|
|
|
USE trainingsdiary;
|
|
|
|
-- 1. Status vor dem finalen Cleanup
|
|
SELECT '=== STATUS VOR FINALEM CLEANUP ===' as info;
|
|
SELECT
|
|
TABLE_NAME,
|
|
COUNT(*) as key_count
|
|
FROM INFORMATION_SCHEMA.STATISTICS
|
|
WHERE TABLE_SCHEMA = 'trainingsdiary'
|
|
GROUP BY TABLE_NAME
|
|
ORDER BY key_count DESC;
|
|
|
|
-- 2. Alle INDEX der Problem-Tabellen anzeigen
|
|
SELECT '=== MEMBER TABELLE INDEX ===' as info;
|
|
SHOW INDEX FROM member;
|
|
|
|
SELECT '=== DIARY_TAGS TABELLE INDEX ===' as info;
|
|
SHOW INDEX FROM diary_tags;
|
|
|
|
SELECT '=== SEASON TABELLE INDEX ===' as info;
|
|
SHOW INDEX FROM season;
|
|
|
|
-- 3. Spezifische INDEX entfernen (basierend auf den echten Namen)
|
|
-- Diese INDEX sind wahrscheinlich überflüssig und können entfernt werden
|
|
|
|
-- Member-Tabelle: Weitere INDEX entfernen
|
|
SELECT '=== ENTFERNE WEITERE MEMBER INDEX ===' as info;
|
|
|
|
-- Versuche, INDEX zu entfernen, die wahrscheinlich überflüssig sind
|
|
-- (Diese Namen basieren auf typischen Sequelize-Konventionen)
|
|
|
|
-- Häufige überflüssige INDEX-Namen
|
|
DROP INDEX IF EXISTS member_hashed_id_unique ON member;
|
|
DROP INDEX IF EXISTS member_first_name_index ON member;
|
|
DROP INDEX IF EXISTS member_last_name_index ON member;
|
|
DROP INDEX IF EXISTS member_birth_date_index ON member;
|
|
DROP INDEX IF EXISTS member_active_index ON member;
|
|
DROP INDEX IF EXISTS member_created_at_index ON member;
|
|
DROP INDEX IF EXISTS member_updated_at_index ON member;
|
|
|
|
-- Alternative INDEX-Namen
|
|
DROP INDEX IF EXISTS idx_member_hashed_id ON member;
|
|
DROP INDEX IF EXISTS idx_member_first_name ON member;
|
|
DROP INDEX IF EXISTS idx_member_last_name ON member;
|
|
DROP INDEX IF EXISTS idx_member_birth_date ON member;
|
|
DROP INDEX IF EXISTS idx_member_active ON member;
|
|
DROP INDEX IF EXISTS idx_member_created_at ON member;
|
|
DROP INDEX IF EXISTS idx_member_updated_at ON member;
|
|
|
|
-- Diary_Tags-Tabelle: Weitere INDEX entfernen
|
|
SELECT '=== ENTFERNE WEITERE DIARY_TAGS INDEX ===' as info;
|
|
|
|
DROP INDEX IF EXISTS diary_tags_name_index ON diary_tags;
|
|
DROP INDEX IF EXISTS diary_tags_created_at_index ON diary_tags;
|
|
DROP INDEX IF EXISTS diary_tags_updated_at_index ON member;
|
|
|
|
-- Alternative INDEX-Namen
|
|
DROP INDEX IF EXISTS idx_diary_tags_name ON diary_tags;
|
|
DROP INDEX IF EXISTS idx_diary_tags_created_at ON diary_tags;
|
|
DROP INDEX IF EXISTS idx_diary_tags_updated_at ON diary_tags;
|
|
|
|
-- Season-Tabelle: Weitere INDEX entfernen
|
|
SELECT '=== ENTFERNE WEITERE SEASON INDEX ===' as info;
|
|
|
|
DROP INDEX IF EXISTS season_name_index ON season;
|
|
DROP INDEX IF EXISTS season_start_date_index ON season;
|
|
DROP INDEX IF EXISTS season_end_date_index ON season;
|
|
DROP INDEX IF EXISTS season_created_at_index ON season;
|
|
DROP INDEX IF EXISTS season_updated_at_index ON season;
|
|
|
|
-- Alternative INDEX-Namen
|
|
DROP INDEX IF EXISTS idx_season_name ON season;
|
|
DROP INDEX IF EXISTS idx_season_start_date ON season;
|
|
DROP INDEX IF EXISTS idx_season_end_date ON season;
|
|
DROP INDEX IF EXISTS idx_season_created_at ON season;
|
|
DROP INDEX IF EXISTS idx_season_updated_at ON season;
|
|
|
|
-- 4. Status nach dem finalen Cleanup
|
|
SELECT '=== STATUS NACH FINALEM CLEANUP ===' as info;
|
|
SELECT
|
|
TABLE_NAME,
|
|
COUNT(*) as key_count
|
|
FROM INFORMATION_SCHEMA.STATISTICS
|
|
WHERE TABLE_SCHEMA = 'trainingsdiary'
|
|
GROUP BY TABLE_NAME
|
|
ORDER BY key_count DESC;
|
|
|
|
-- 5. Gesamtanzahl der Keys
|
|
SELECT
|
|
COUNT(*) as total_keys_after_final_cleanup
|
|
FROM INFORMATION_SCHEMA.STATISTICS
|
|
WHERE TABLE_SCHEMA = 'trainingsdiary';
|
|
|
|
-- 6. Zusammenfassung
|
|
SELECT '=== ZUSAMMENFASSUNG ===' as info;
|
|
SELECT
|
|
'Finales Cleanup abgeschlossen. Überprüfen Sie die Anzahl der Keys oben.' as message;
|