This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
databaseChangeLog = { | |
changeSet(author: "adriano (generated)", id: "1473359854018-3") { | |
sql(""" | |
INSERT INTO bla (field) values (1); | |
""") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In BootStrap.conf | |
// TimeZone.availableIDs -> ['Etc/GMT+12', 'Etc/GMT+11', 'Pacific/Midway', 'Pacific/Niue'..... | |
TimeZone.setDefault(TimeZone.getTimeZone("America/Sao_Paulo")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Required install PV (Pipe Viewer) | |
Create dump.*/ | |
$ mysqldump --single-transaction --skip-add-locks --skip-comments -uroot -proot schema | pv | gzip -c > file.sql.gz | |
/*Restore dump.*/ | |
$ pv file.sql.gz | gunzip | mysql -uroot -proot schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump -uroot -proot schema_name table_name -w "date between '2013-01-01 00:00:00' and now()" | \ | |
gzip > schema_name_table_name.sql.gz | |
Restore dump. | |
$ gunzip schema_name_table_name.sql.gz | mysql -uroot -proot schema_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump -uroot -proot --all-databases | gzip > file.sql.gz | |
Restore dump. | |
$ gunzip file.sql.gz | mysqldump -uroot -proot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump -uroot -proot -B schema --table table_name | gzip > file_schema_table.sql.gz | |
Restore dump | |
$ gunzip file_schema_table.sql.gz | mysqldump -uroot -proot schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump --single-transaction --skip-add-locks --skip-comments -uroot -proot schema | gzip -c > file.sql.gz | |
Restore dump. | |
$ gunzip < file.sql.gz | mysql -uroot -proot schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump -uroot -proot schema | gzip -c > file.sql.gz | |
Restore dump. | |
$ gunzip < file.sql.gz | mysqldump -uroot -proot schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create dump. | |
$ mysqldump -uroot -proot schema_name > file.sql | |
Restore dump. | |
$ mysql -uroot -proot schema_name < file.sql |
NewerOlder