From 67f2611bf53de72c2e7d29db1f8e983238a97ca6 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 27 Jan 2011 08:38:27 +0100 Subject: [PATCH] sql contents and structure files added --- sql/sql.d/001-struct.sql | 18 ++++++++++++++++++ sql/sql.d/005-anagr.sql | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sql/sql.d/001-struct.sql create mode 100644 sql/sql.d/005-anagr.sql diff --git a/sql/sql.d/001-struct.sql b/sql/sql.d/001-struct.sql new file mode 100644 index 0000000..a95af6b --- /dev/null +++ b/sql/sql.d/001-struct.sql @@ -0,0 +1,18 @@ +-- TODO +-- DONE - CASCADE ON DELETE of orders related tables +-- DONE - STATUS on orders + +DROP TABLE #PFX#users; +CREATE TABLE #PFX#users ( + code integer PRIMARY KEY, + login text, + pass text, + email text, + type integer + ); + +DROP TABLE #PFX#groups; +CREATE TABLE #PFX#groups ( + code integer PRIMARY KEY, + gname text + ); diff --git a/sql/sql.d/005-anagr.sql b/sql/sql.d/005-anagr.sql new file mode 100644 index 0000000..d97df09 --- /dev/null +++ b/sql/sql.d/005-anagr.sql @@ -0,0 +1,15 @@ +-- +-- Populate users db. +-- + +-- macro for user_flag bit-field +-- define(USER_FLAG_TY_ALL, 0x000f0000); // done +-- define(USER_FLAG_TY_NORM, 0x00010000); // done +-- define(USER_FLAG_TY_SUPER, 0x00020000); // done + +INSERT INTO #PFX#users VALUES (1, 'uno', md5('one'), 'uno@pluto.com', CAST (X'00020000' as integer)); +INSERT INTO #PFX#users VALUES (2, 'due', md5('two'), 'due@pluto.com', CAST (X'00010000' as integer)); +INSERT INTO #PFX#users VALUES (3, 'tre', md5('thr'), 'tre@pluto.com', CAST (X'00010000' as integer)); +INSERT INTO #PFX#users VALUES (4, 'qua', md5('for'), 'qua@pluto.com', CAST (X'00010000' as integer)); +INSERT INTO #PFX#users VALUES (5, 'cin', md5('fiv'), 'cin@pluto.com', CAST (X'00010000' as integer)); + -- 2.17.1