more robust sql scripts adding IF EXISTS to DROP TABLE statementes
[brisk.git] / sql / sql.d / 054-continue-match.sql
index 3db1ff9..e95059a 100644 (file)
@@ -1,8 +1,8 @@
-DROP TABLE #PFX#bin5_table_orders;
+DROP TABLE IF EXISTS #PFX#bin5_table_orders;
 CREATE TABLE #PFX#bin5_table_orders (
        mcode  integer REFERENCES #PFX#bin5_matches (code) ON DELETE cascade ON UPDATE cascade,
-       ucode  integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade, 
-       pos    integer
+       pos    integer,
+       ucode  integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade
        );
 
 ALTER TABLE #PFX#bin5_matches DROP COLUMN mult_next;