mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 08:10:24 +01:00
serial run delete from "${table}" cascade
This commit is contained in:
parent
083e3fb75d
commit
d7834d0843
1 changed files with 3 additions and 1 deletions
|
@ -220,7 +220,9 @@ export async function resetDb() {
|
||||||
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
|
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
|
||||||
AND C.relkind = 'r'
|
AND C.relkind = 'r'
|
||||||
AND nspname !~ '^pg_toast';`);
|
AND nspname !~ '^pg_toast';`);
|
||||||
await Promise.all(tables.map(t => t.table).map(x => conn.query(`DELETE FROM "${x}" CASCADE`)));
|
for (const table of tables) {
|
||||||
|
await conn.query(`DELETE FROM "${table.table}" CASCADE`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let i = 1; i <= 3; i++) {
|
for (let i = 1; i <= 3; i++) {
|
||||||
|
|
Loading…
Reference in a new issue