Add the sql to final migration file format script.

migration
Philippe PITTOLI 2024-06-22 01:34:39 +02:00
parent 835415caac
commit cc4df1775c
1 changed files with 23 additions and 0 deletions

23
bin/sql-to-migration-format.awk Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/awk -f
BEGIN {
OFS = "\t"
}
{
login = $1
domain = $3
data[login][domain] = 1
}
END {
for ( login in data ) {
domains = ""
nb = 0
for ( domain in data[login] ) {
nb += 1
domains = (domains "\t" domain)
}
print nb, login, domains
}
}