This file contains hidden or 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
## Importar partidos | |
INSERT INTO electoralparty | |
(`id`, | |
`name`, | |
`resumeName`, | |
`isActive`, | |
`identifier`) | |
SELECT (SELECT UUID()), nm_partido, sg_partido, 1, nr_partido | |
from (select distinct nm_partido, sg_partido, 1, nr_partido from tse2018am) as partidos | |
left join electoralparty ep on ep.identifier = partidos.NR_PARTIDO |
This file contains hidden or 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
* crie a tabela para receber os dados. Pode usar a tabela tse2018am (zerar antes) ou copiar sua estrutura para uma nova tabela | |
* converter arquivo para latin1: | |
iconv -f ISO-8859-1 -t UTF-8 /var/lib/mysql-files/tse.csv -o /var/lib/mysql-files/tse_utf8.csv | |
* copiar para Docker (se preciso): | |
docker cp tse_utf8.csv lhince-db:/var/lib/mysql-files/tse_utf8.csv | |
* Fazer login no mysql e carregar o csv para a tabela com o comando abaixo |