Skip to content

Instantly share code, notes, and snippets.

View liupeng0518's full-sized avatar
🎯
Focusing

Samuel Liu liupeng0518

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Jenkins Configuraitons Directory
cd $JENKINS_HOME
# Add general configurations, job configurations, and user content
git add -- *.xml jobs/*/*.xml userContent/* ansible/*
# only add user configurations if they exist
if [ -d users ]; then
user_configs=`ls users/*/config.xml`
@JonLatane
JonLatane / mysql_index_migration_procs.sql
Last active December 29, 2023 07:28 — forked from drawcode/mysql_drop_index_if_exists.sql
MYSQL stored procedures for "Drop Index If Exists" and "Create Or Update Index"
DELIMITER $$
DROP PROCEDURE IF EXISTS drop_index_if_exists $$
CREATE PROCEDURE drop_index_if_exists(in theIndexName varchar(128), in theTable varchar(128))
BEGIN
IF((SELECT COUNT(*) AS index_exists FROM information_schema.statistics WHERE TABLE_SCHEMA = DATABASE() and table_name =
theTable AND index_name = theIndexName) > 0) THEN
SET @s = CONCAT('DROP INDEX `' , theIndexName , '` ON `' , theTable, '`');
PREPARE stmt FROM @s;
EXECUTE stmt;
END IF;