github.com/mattermost/mattermost-server/v6@v6.7.2/config/migrations/mysql/000003_update_configurations_sha.up.sql (about)

     1  SET @preparedStatement = (SELECT IF(
     2      (
     3          SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
     4          WHERE table_name = 'Configurations'
     5          AND table_schema = DATABASE()
     6          AND column_name = 'SHA'
     7      ) > 0,
     8      'SELECT 1',
     9      'ALTER TABLE Configurations ADD COLUMN SHA char(64) DEFAULT "";'
    10  ));
    11  
    12  PREPARE alterIfNotExists FROM @preparedStatement;
    13  EXECUTE alterIfNotExists;
    14  DEALLOCATE PREPARE alterIfNotExists;