From c97d3ce3b7f4f4c2a817b4c868795681682563ba Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Tue, 3 Sep 2013 18:31:18 +0200 Subject: [PATCH] set sequence value after some row inserts and add sql stuff for continue match feature --- sql/sql.d/054-continue-match.sql | 10 ++++++++++ sql/sql.d/100-anagr.sql.noinsert | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 sql/sql.d/054-continue-match.sql diff --git a/sql/sql.d/054-continue-match.sql b/sql/sql.d/054-continue-match.sql new file mode 100644 index 0000000..4ffb5b4 --- /dev/null +++ b/sql/sql.d/054-continue-match.sql @@ -0,0 +1,10 @@ +DROP TABLE #PFX#bin5_table_order; +CREATE TABLE #PFX#bin5_table_order ( + 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 + ); + +ALTER TABLE #PFX#bin5_matches ADD COLUMN mult_next integer DEFAULT 1; -- current multiplier +ALTER TABLE #PFX#bin5_matches ADD COLUMN mazzo_next integer; -- current card shaker + diff --git a/sql/sql.d/100-anagr.sql.noinsert b/sql/sql.d/100-anagr.sql.noinsert index d902048..ae74efd 100644 --- a/sql/sql.d/100-anagr.sql.noinsert +++ b/sql/sql.d/100-anagr.sql.noinsert @@ -15,4 +15,4 @@ INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (2, 'due', INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (3, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer), 0); INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (4, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00210000' as integer), 0); INSERT INTO #PFX#users (code, login, pass, email, type, flags) VALUES (5, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer), 0); - +ALTER SEQUENCE #PFX#users_code_seq RESTART WITH 6; -- 2.17.1