SHARE
TWEET

HSQLDB script for Ametys

a guest Jul 3rd, 2013 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE CACHED TABLE "Groups" (
  2.   "Id" int PRIMARY KEY NOT NULL IDENTITY,
  3.   "Label" VARCHAR(200)
  4. );
  5.  
  6. CREATE CACHED TABLE "Groups_Users" (
  7.   "Group_Id" int NOT NULL,
  8.   "Login" VARCHAR (200) NOT NULL,
  9.   PRIMARY KEY ("Group_Id", "Login")
  10.  );
  11.  
  12. CREATE CACHED TABLE "Users" (
  13.   "login" varchar(64) PRIMARY KEY NOT NULL,
  14.   "firstname" varchar(64) default NULL,
  15.   "lastname" varchar(64) NOT NULL,
  16.   "email" varchar(64) DEFAULT NULL,
  17.   "password" varchar(128)  NOT NULL
  18. );
  19.  
  20. CREATE CACHED TABLE "Newsletter_Subscribers" (
  21.         "Email" VARCHAR(255) not null,
  22.         "Site_Name" VARCHAR(48) NOT NULL,
  23.         "Category" VARCHAR(64) NOT NULL,
  24.         "Subscribed_At" date not null,
  25.         "Token" VARCHAR(64) NOT NULL,
  26.         PRIMARY KEY("Email", "Site_Name", "Category")
  27. );
  28.  
  29. CREATE CACHED TABLE "Rights_Profile" (
  30.         "Id" int PRIMARY KEY NOT NULL IDENTITY,
  31.         "Label" VARCHAR(200),
  32.         "Context" VARCHAR(200)
  33. );
  34.  
  35. CREATE CACHED TABLE "Rights_ProfileRights" (
  36.         "Profile_Id" int NOT NULL,
  37.         "Right_Id" VARCHAR(200) NOT NULL,
  38.         PRIMARY KEY("Profile_Id", "Right_Id")
  39. );
  40.  
  41. CREATE CACHED TABLE "Rights_GroupRights" (
  42.         "Profile_Id" int NOT NULL,
  43.         "Group_Id" VARCHAR(200) NOT NULL,
  44.         "Context" VARCHAR(200) NOT NULL,
  45.         PRIMARY KEY("Profile_Id", "Group_Id", "Context")
  46. );
  47.  
  48. CREATE CACHED TABLE "Rights_UserRights" (
  49.         "Profile_Id" int NOT NULL,
  50.         "Login" VARCHAR(200) NOT NULL,
  51.         "Context" VARCHAR(200) NOT NULL,
  52.         PRIMARY KEY("Profile_Id", "Login", "Context")
  53. );
  54.  
  55. CREATE CACHED TABLE "UserPreferences" (
  56.   "login" varchar(32) NOT NULL,
  57.   "context" varchar(128) NOT NULL,
  58.   "data" BLOB,
  59.   PRIMARY KEY("login", "context")
  60. );
  61.  
  62. CREATE CACHED TABLE "Cache_RA_HTTPServer" (
  63.   "Unique_Id" VARCHAR(255) NOT NULL,
  64.   "Site" VARCHAR(255) NOT NULL,
  65.   "Request_Date" TIMESTAMP NOT NULL,
  66.   "Method" VARCHAR(255) NOT NULL,
  67.   "Path_Hash" VARCHAR(255) NOT NULL,
  68.   "Path" VARCHAR(4000) NOT NULL,
  69.   "Query_String" VARCHAR(4000) NOT NULL,
  70.   "Ori_Status_Code" CHAR(3) NOT NULL,
  71.   "Ret_Status_Code" CHAR(3) NOT NULL,
  72.   "Cache_Hit" SMALLINT NOT NULL,
  73.   "Created_At" TIMESTAMP NOT NULL,
  74.   "Processed" SMALLINT DEFAULT 0 NOT NULL,
  75.   PRIMARY KEY ("Unique_Id")
  76. );
  77.  
  78. CREATE CACHED TABLE "Cache_RA_Front" (
  79.   "Unique_Id" VARCHAR(255) NOT NULL,
  80.   "Internal_Uuid" VARCHAR(255) NOT NULL,
  81.   "Site" VARCHAR(255) NOT NULL,
  82.   "Ametys_Path_Hash" VARCHAR(255) NOT NULL,
  83.   "Ametys_Path" VARCHAR(4000) NOT NULL,
  84.   "Cacheable" SMALLINT NOT NULL,
  85.   "Cache_Hit_1" SMALLINT NOT NULL,
  86.   "Cache_Hit_2" SMALLINT NOT NULL,
  87.   "Created_At" TIMESTAMP NOT NULL,
  88.   "Processed" SMALLINT DEFAULT 0 NOT NULL
  89. );
  90.  
  91. CREATE CACHED TABLE "Cache_RA_Back" (
  92.   "Internal_Uuid" VARCHAR(255) NOT NULL,
  93.   "Page_Id" VARCHAR(255) NOT NULL,
  94.   "Page_Path_Hash" VARCHAR(255) NOT NULL,
  95.   "Page_Path" VARCHAR(4000) NOT NULL,
  96.   "Rendering_Context" VARCHAR(255) NOT NULL,
  97.   "Workspace_JCR" VARCHAR(255) NOT NULL,
  98.   "Cacheable" SMALLINT NOT NULL,
  99.   "Created_At" TIMESTAMP NOT NULL,
  100.   "Processed" SMALLINT DEFAULT 0 NOT NULL
  101. );
  102.  
  103. CREATE CACHED TABLE "Cache_RA_Back_Page_Element" (
  104.   "Internal_Uuid" VARCHAR(255) NOT NULL,
  105.   "Page_Element_Id" VARCHAR(255) NOT NULL,
  106.   "Page_Element_Type" VARCHAR(255) NOT NULL,
  107.   "Page_Id" VARCHAR(255) NOT NULL,
  108.   "Rendering_Context" VARCHAR(255) NOT NULL,
  109.   "Workspace_JCR" VARCHAR(255) NOT NULL,
  110.   "Cacheable" SMALLINT NOT NULL,
  111.   "Cache_Hit" SMALLINT NOT NULL,
  112.   "Created_At" TIMESTAMP NOT NULL,
  113.   "Processed" SMALLINT DEFAULT 0 NOT NULL
  114. );
  115.  
  116. CREATE CACHED TABLE "Cache_Stats_Front" (
  117.   "Server_Site" VARCHAR(255) DEFAULT '-' NOT NULL,
  118.   "Server_Path_Hash" VARCHAR(255) DEFAULT '-' NOT NULL,
  119.   "Server_Path" VARCHAR(4000),
  120.   "Server_Hits" INT DEFAULT 0 NOT NULL,
  121.   "Server_Cache_Hits" INT DEFAULT 0 NOT NULL,
  122.   "Front_Site" VARCHAR(255) DEFAULT '-' NOT NULL,
  123.   "Front_Path_Hash" VARCHAR(255) DEFAULT '-' NOT NULL,
  124.   "Front_Path" VARCHAR(4000),
  125.   "Front_Cacheable" SMALLINT DEFAULT 0 NOT NULL,
  126.   "Front_Hits" INT DEFAULT 0 NOT NULL,
  127.   "Front_Cache_Hits_1" INT DEFAULT 0 NOT NULL,
  128.   "Front_Cache_Hits_2" INT DEFAULT 0 NOT NULL,
  129.   "Created_At" TIMESTAMP NOT NULL,
  130.   "Updated_At" TIMESTAMP NOT NULL,
  131.   UNIQUE ("Server_Site", "Server_Path_Hash", "Front_Site", "Front_Path_Hash")
  132. );
  133.  
  134. CREATE CACHED TABLE "Cache_Stats_Back" (
  135.   "Page_Id" VARCHAR(255) NOT NULL,
  136.   "Page_Path_Hash" VARCHAR(255) NOT NULL,
  137.   "Page_Path" VARCHAR(4000) NOT NULL,
  138.   "Rendering_Context" VARCHAR(255) NOT NULL,
  139.   "Workspace_JCR" VARCHAR(255) NOT NULL,
  140.   "Cacheable" SMALLINT NOT NULL,
  141.   "Hits" INT NOT NULL,
  142.   "Created_At" TIMESTAMP NOT NULL,
  143.   "Updated_At" TIMESTAMP NOT NULL,
  144.   PRIMARY KEY ("Page_Id", "Rendering_Context", "Workspace_JCR")
  145. );
  146.  
  147. CREATE CACHED TABLE "Cache_Stats_Back_Page_Element" (
  148.   "Page_Element_Id" VARCHAR(255) NOT NULL,
  149.   "Page_Id" VARCHAR(255) NOT NULL,
  150.   "Rendering_Context" VARCHAR(255) NOT NULL,
  151.   "Workspace_JCR" VARCHAR(255) NOT NULL,
  152.   "Cacheable" SMALLINT NOT NULL,
  153.   "Hits" INT NOT NULL,
  154.   "Cache_Hits" INT NOT NULL,
  155.   "Created_At" TIMESTAMP NOT NULL,
  156.   "Updated_At" TIMESTAMP NOT NULL,
  157.   PRIMARY KEY ("Page_Element_Id", "Page_Id", "Rendering_Context", "Workspace_JCR")
  158. );
  159.  
  160. CREATE CACHED TABLE "FOUsers" (
  161.   "login" varchar(255) PRIMARY KEY NOT NULL,
  162.   "firstname" varchar(64) default NULL,
  163.   "lastname" varchar(64) NOT NULL,
  164.   "email" varchar(64) DEFAULT NULL,
  165.   "password" varchar(128)  NOT NULL
  166. );
  167.  
  168. CREATE CACHED TABLE "FOUserPreferences" (
  169.   "login" varchar(255) NOT NULL,
  170.   "context" varchar(128) NOT NULL,
  171.   "data" BLOB,
  172.   PRIMARY KEY("login", "context")
  173. );
  174.  
  175. CREATE CACHED TABLE "Users_Temp" (
  176.   "site" varchar(255) NOT NULL,
  177.   "email" varchar(255) NOT NULL,
  178.   "firstname" varchar(64) NOT NULL,
  179.   "lastname" varchar(64) NOT NULL,
  180.   "subscription_date" TIMESTAMP NOT NULL,
  181.   "token" varchar(128) NOT NULL,
  182.   PRIMARY KEY ("site", "email"),
  183.   UNIQUE ("token")
  184. );
  185.  
  186. CREATE CACHED TABLE "Users_PasswordChange" (
  187.   "site" varchar(255) NOT NULL,
  188.   "login" varchar(255) NOT NULL,
  189.   "request_date" TIMESTAMP NOT NULL,
  190.   "token" varchar(128) NOT NULL,
  191.   PRIMARY KEY("site", "login")
  192. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top