SQLDump performs an SQL database dump of the dev database to the .cache folder.
()
| 106 | |
| 107 | // SQLDump performs an SQL database dump of the dev database to the .cache folder. |
| 108 | func (Dev) SQLDump() error { |
| 109 | if mg.Verbose() { |
| 110 | fmt.Println("Saving sql database dump") |
| 111 | } |
| 112 | if err := os.MkdirAll(path.Join(".env", "cache"), 0o755); err != nil { |
| 113 | return err |
| 114 | } |
| 115 | return execDockerCompose("exec", "-T", "postgres", |
| 116 | "pg_dump", "-Fc", "-f", "/var/lib/ttn-lorawan/cache/database.pgdump", devDatabaseName, |
| 117 | ) |
| 118 | } |
| 119 | |
| 120 | // SQLRestore restores the dev database using a previously generated dump. |
| 121 | func (Dev) SQLRestore() error { |
nothing calls this directly
no test coverage detected