testsuite.sql 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. -- Database: testsuite
  2. -- DROP DATABASE IF EXISTS testsuite;
  3. CREATE DATABASE testsuite
  4. WITH
  5. OWNER = fpc
  6. ENCODING = 'UTF8'
  7. LC_COLLATE = 'en_GB.UTF-8'
  8. LC_CTYPE = 'en_GB.UTF-8'
  9. TABLESPACE = pg_default
  10. CONNECTION LIMIT = -1
  11. IS_TEMPLATE = False;
  12. CREATE SEQUENCE SEQ_TESTCATEGORY as INT start with 1;
  13. CREATE TABLE TESTCATEGORY (
  14. TA_ID INT NOT NULL DEFAULT nextval('SEQ_TESTCATEGORY'),
  15. TA_NAME VARCHAR(20),
  16. constraint PK_TESTCATEGORY PRIMARY KEY (TA_ID)
  17. );
  18. CREATE UNIQUE INDEX UDX_TESTCATEGORYNAME ON TESTCATEGORY(TA_NAME);
  19. CREATE SEQUENCE SEQ_TESTCPU as INT start with 1;
  20. CREATE TABLE TESTCPU (
  21. TC_ID INT NOT NULL DEFAULT nextval('SEQ_TESTCPU'),
  22. TC_NAME varchar(10),
  23. constraint PK_TESTCPU PRIMARY KEY (TC_ID)
  24. );
  25. CREATE UNIQUE INDEX UDX_TESTCPU ON TESTCPU(TC_NAME);
  26. CREATE SEQUENCE SEQ_TESTOS as INT start with 1;
  27. CREATE TABLE TESTOS (
  28. TO_ID INT DEFAULT nextval('SEQ_TESTOS'),
  29. TO_NAME varchar(10),
  30. constraint PK_TESTOS PRIMARY KEY (TO_ID)
  31. );
  32. CREATE UNIQUE INDEX UDX_TESTOS ON TESTOS(TO_NAME);
  33. CREATE SEQUENCE SEQ_TESTVERSION as INT start with 1;
  34. CREATE TABLE TESTVERSION (
  35. TV_ID int NOT NULL default nextval('SEQ_TESTVERSION'),
  36. TV_VERSION varchar(10),
  37. TV_RELEASEDATE date DEFAULT CURRENT_TIMESTAMP,
  38. constraint PK_TESTVERSION PRIMARY KEY (TV_ID)
  39. );
  40. CREATE UNIQUE INDEX UDX_TESTVERSION ON TESTVERSION(TV_VERSION);
  41. CREATE SEQUENCE SEQ_TESTS as INT start with 1;
  42. CREATE TABLE TESTS (
  43. T_ID int NOT NULL default nextval('SEQ_TESTS'),
  44. T_NAME varchar(40),
  45. T_CPU varchar(20),
  46. T_OS varchar(30),
  47. T_VERSION varchar(10),
  48. T_ADDDATE date NOT NULL,
  49. T_GRAPH boolean NOT NULL default 'f',
  50. T_INTERACTIVE boolean NOT NULL default 'f',
  51. T_RESULT int NOT NULL default '0',
  52. T_FAIL boolean NOT NULL default 'f',
  53. T_RECOMPILE boolean NOT NULL default 'f',
  54. T_NORUN boolean NOT NULL default 'f',
  55. T_NEEDLIBRARY boolean NOT NULL default 'f',
  56. T_KNOWNRUNERROR INT NOT NULL default 0,
  57. T_KNOWN boolean NOT NULL default 'f',
  58. T_NOTE varchar(255) default NULL,
  59. T_DESCRIPTION text,
  60. T_SOURCE text,
  61. T_OPTS varchar(255) default NULL,
  62. constraint PK_TESTS PRIMARY KEY (T_ID)
  63. );
  64. CREATE UNIQUE INDEX UDX_TESTS ON TESTS(T_NAME);
  65. CREATE SEQUENCE SEQ_TESTPLATFORM as INT start with 1;
  66. CREATE TABLE TESTPLATFORM (
  67. TP_ID INT NOT NULL default nextval('SEQ_TESTPLATFORM'),
  68. TP_CPU_FK INT NOT NULL,
  69. TP_OS_FK INT NOT NULL,
  70. TP_VERSION_FK INT NOT NULL,
  71. TP_CATEGORY_FK int NOT NULL,
  72. TP_CONFIG VARCHAR(255) NOT NULL,
  73. constraint PK_TESTPLATFORM PRIMARY KEY (TP_ID)
  74. );
  75. CREATE UNIQUE INDEX UDX_TESTPLATFORM ON TESTPLATFORM(TP_CPU_FK,TP_OS_FK,TP_VERSION_FK,TP_CATEGORY_FK,TP_CONFIG);
  76. CREATE INDEX IDX_TESTPLATFORMRELATIONS ON TESTPLATFORM(TP_CPU_FK,TP_OS_FK,TP_VERSION_FK,TP_CATEGORY_FK);
  77. CREATE SEQUENCE SEQ_TESTRUN as BIGINT start with 1;
  78. CREATE TABLE TESTRUN (
  79. TU_ID bigint NOT NULL default nextval('SEQ_TESTRUN'),
  80. TU_DATE DATE NOT NULL default CURRENT_DATE,
  81. TU_PLATFORM_FK int NOT NULL,
  82. TU_MACHINE VARCHAR(127) NOT NULL,
  83. TU_COMPILERDATE VARCHAR(15),
  84. TU_COMPILERFULLVERSION VARCHAR(50),
  85. TU_COMPILERREVISION VARCHAR(50),
  86. TU_TESTSREVISION VARCHAR(50),
  87. TU_RTLREVISION VARCHAR(50),
  88. TU_PACKAGESREVISION VARCHAR(50),
  89. TU_SUBMITTER varchar(128) NOT NULL default '',
  90. TU_FAILEDTOCOMPILE int NOT NULL default 0,
  91. TU_SUCCESSFULLYFAILED int NOT NULL default 0,
  92. TU_FAILEDTOFAIL int NOT NULL default 0,
  93. TU_SUCCESFULLYCOMPILED int NOT NULL default 0,
  94. TU_FAILEDTORUN int NOT NULL default 0,
  95. TU_KNOWNPROBLEM int NOT NULL default 0,
  96. TU_SUCCESSFULLYRUN int NOT NULL default 0,
  97. TU_SKIPPEDGRAPHTEST int NOT NULL default 0,
  98. TU_SKIPPEDINTERACTIVETEST int NOT NULL default 0,
  99. TU_KNOWNBUG int NOT NULL default 0,
  100. TU_COMPILERVERIONTOOLOW int NOT NULL default 0,
  101. TU_COMPILERVERIONTOOHIGH int NOT NULL default 0,
  102. TU_OTHERCPU int NOT NULL default 0,
  103. TU_OTHERTARGET int NOT NULL default 0,
  104. TU_UNIT int NOT NULL default 0,
  105. TU_SKIPPINGRUNTEST int NOT NULL default 0,
  106. CONSTRAINT PK_TESTRUN PRIMARY KEY (TU_ID)
  107. );
  108. CREATE UNIQUE INDEX UDX_TESTRUN ON TESTRUN(TU_DATE,TU_PLATFORM_FK);
  109. CREATE INDEX IDX_TESTRUNPLATFORM ON TESTRUN(TU_PLATFORM_FK,TU_DATE);
  110. CREATE SEQUENCE SEQ_TESTRESULTS as BIGINT start with 1;
  111. CREATE TABLE TESTRESULTS (
  112. TR_ID bigint NOT NULL default nextval('SEQ_TESTRESULTS'),
  113. TR_TESTRUN_FK bigint NOT NULL default 0,
  114. TR_TEST_FK int not NULL,
  115. TR_OK Boolean NOT NULL default 'f',
  116. TR_SKIP boolean NOT NULL default 'f',
  117. TR_RESULT int NOT NULL default 0,
  118. TR_LOG text,
  119. constraint PK_TESTRESULTS PRIMARY KEY (TR_ID)
  120. );
  121. CREATE UNIQUE INDEX UDX_TESTRESULTS ON TESTRESULTS (TR_TESTRUN_FK,TR_TEST_FK);
  122. CREATE TABLE TESTLASTRESULTS (
  123. TL_TEST_FK int not NULL,
  124. TL_PLATFORM_FK int not NULL,
  125. TL_TESTRESULTS_FK bigint NOT NULL
  126. );
  127. CREATE UNIQUE INDEX UDX_TESTLASTRESULTS ON TESTLASTRESULTS(TL_PLATFORM_FK,TL_TEST_FK);
  128. CREATE TABLE TESTPREVIOUSRESULTS (
  129. TPR_TEST_FK int not NULL,
  130. TPR_PLATFORM_FK int not NULL,
  131. TPR_TESTRESULTS_FK bigint NOT NULL
  132. );
  133. CREATE UNIQUE INDEX UDX_TESTPREVIOUSRESULTS ON TESTPREVIOUSRESULTS(TPR_PLATFORM_FK,TPR_TEST_FK);