Skip to content

Commit baeb9e5

Browse files
committed
Remove backticks cleanup
1 parent f6e7e64 commit baeb9e5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

dev/prepare_db.pql

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ func run_sql(code) {
55
}
66

77
// Cleanup
8+
func cleanup() {
9+
run_sql("DROP TABLE IF EXISTS Rating")
10+
run_sql("DROP TABLE IF EXISTS tmp_rating")
11+
run_sql("DROP TABLE IF EXISTS Rating_del1")
12+
run_sql("DROP TABLE IF EXISTS Rating_update1")
13+
run_sql("DROP TABLE IF EXISTS Rating_update001p")
14+
run_sql("DROP TABLE IF EXISTS Rating_update1p")
15+
run_sql("DROP TABLE IF EXISTS Rating_del1p")
16+
run_sql("DROP TABLE IF EXISTS Rating_update50p")
17+
commit()
18+
}
19+
820
func cleanup_double_quote() {
921
run_sql("DROP TABLE IF EXISTS \"Rating\"")
1022
run_sql("DROP TABLE IF EXISTS \"tmp_rating\"")
@@ -17,22 +29,10 @@ func cleanup_double_quote() {
1729
commit()
1830
}
1931

20-
func cleanup_backtick() {
21-
run_sql("DROP TABLE IF EXISTS `Rating`")
22-
run_sql("DROP TABLE IF EXISTS `tmp_rating`")
23-
run_sql("DROP TABLE IF EXISTS `Rating_del1`")
24-
run_sql("DROP TABLE IF EXISTS `Rating_update1`")
25-
run_sql("DROP TABLE IF EXISTS `Rating_update001p`")
26-
run_sql("DROP TABLE IF EXISTS `Rating_update1p`")
27-
run_sql("DROP TABLE IF EXISTS `Rating_del1p`")
28-
run_sql("DROP TABLE IF EXISTS `Rating_update50p`")
29-
commit()
30-
}
31-
32-
if (db_type == "mysql") {
33-
cleanup_backtick()
34-
} else {
32+
if (db_type == "postgres" or db_type == "redshift") {
3533
cleanup_double_quote()
34+
} else {
35+
cleanup()
3636
}
3737

3838
// Import CSV

0 commit comments

Comments
 (0)