0009_aim_directory.up.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. CREATE TABLE aimKeywordCategory
  2. (
  3. id INTEGER PRIMARY KEY,
  4. name TEXT NOT NULL UNIQUE
  5. );
  6. CREATE TABLE aimKeyword
  7. (
  8. id INTEGER PRIMARY KEY,
  9. name TEXT NOT NULL UNIQUE,
  10. parent INTEGER,
  11. FOREIGN KEY (parent) REFERENCES aimKeywordCategory (id) ON DELETE CASCADE
  12. );
  13. ALTER TABLE users
  14. RENAME TO users_old;
  15. CREATE TABLE users
  16. (
  17. identScreenName VARCHAR(16) PRIMARY KEY,
  18. displayScreenName TEXT,
  19. authKey TEXT,
  20. strongMD5Pass TEXT,
  21. weakMD5Pass TEXT,
  22. confirmStatus BOOLEAN DEFAULT FALSE,
  23. emailAddress VARCHAR(320) NOT NULL DEFAULT '',
  24. regStatus INT NOT NULL DEFAULT 3,
  25. isICQ BOOLEAN NOT NULL DEFAULT false,
  26. aim_firstName TEXT NOT NULL DEFAULT '',
  27. aim_lastName TEXT NOT NULL DEFAULT '',
  28. aim_middleName TEXT NOT NULL DEFAULT '',
  29. aim_maidenName TEXT NOT NULL DEFAULT '',
  30. aim_country TEXT NOT NULL DEFAULT '',
  31. aim_state TEXT NOT NULL DEFAULT '',
  32. aim_city TEXT NOT NULL DEFAULT '',
  33. aim_nickName TEXT NOT NULL DEFAULT '',
  34. aim_zipCode TEXT NOT NULL DEFAULT '',
  35. aim_address TEXT NOT NULL DEFAULT '',
  36. aim_keyword1 INTEGER,
  37. aim_keyword2 INTEGER,
  38. aim_keyword3 INTEGER,
  39. aim_keyword4 INTEGER,
  40. aim_keyword5 INTEGER,
  41. icq_affiliations_currentCode1 INTEGER NOT NULL DEFAULT 0,
  42. icq_affiliations_currentCode2 INTEGER NOT NULL DEFAULT 0,
  43. icq_affiliations_currentCode3 INTEGER NOT NULL DEFAULT 0,
  44. icq_affiliations_currentKeyword1 TEXT NOT NULL DEFAULT '',
  45. icq_affiliations_currentKeyword2 TEXT NOT NULL DEFAULT '',
  46. icq_affiliations_currentKeyword3 TEXT NOT NULL DEFAULT '',
  47. icq_affiliations_pastCode1 INTEGER NOT NULL DEFAULT 0,
  48. icq_affiliations_pastCode2 INTEGER NOT NULL DEFAULT 0,
  49. icq_affiliations_pastCode3 INTEGER NOT NULL DEFAULT 0,
  50. icq_affiliations_pastKeyword1 TEXT NOT NULL DEFAULT '',
  51. icq_affiliations_pastKeyword2 TEXT NOT NULL DEFAULT '',
  52. icq_affiliations_pastKeyword3 TEXT NOT NULL DEFAULT '',
  53. icq_basicInfo_address TEXT NOT NULL DEFAULT '',
  54. icq_basicInfo_cellPhone TEXT NOT NULL DEFAULT '',
  55. icq_basicInfo_city TEXT NOT NULL DEFAULT '',
  56. icq_basicInfo_countryCode INTEGER NOT NULL DEFAULT 0,
  57. icq_basicInfo_emailAddress TEXT NOT NULL DEFAULT '',
  58. icq_basicInfo_fax TEXT NOT NULL DEFAULT '',
  59. icq_basicInfo_firstName TEXT NOT NULL DEFAULT '',
  60. icq_basicInfo_gmtOffset INTEGER NOT NULL DEFAULT 0,
  61. icq_basicInfo_lastName TEXT NOT NULL DEFAULT '',
  62. icq_basicInfo_nickName TEXT NOT NULL DEFAULT '',
  63. icq_basicInfo_phone TEXT NOT NULL DEFAULT '',
  64. icq_basicInfo_publishEmail BOOLEAN NOT NULL DEFAULT false,
  65. icq_basicInfo_state TEXT NOT NULL DEFAULT '',
  66. icq_basicInfo_zipCode TEXT NOT NULL DEFAULT '',
  67. icq_interests_code1 INTEGER NOT NULL DEFAULT 0,
  68. icq_interests_code2 INTEGER NOT NULL DEFAULT 0,
  69. icq_interests_code3 INTEGER NOT NULL DEFAULT 0,
  70. icq_interests_code4 INTEGER NOT NULL DEFAULT 0,
  71. icq_interests_keyword1 TEXT NOT NULL DEFAULT '',
  72. icq_interests_keyword2 TEXT NOT NULL DEFAULT '',
  73. icq_interests_keyword3 TEXT NOT NULL DEFAULT '',
  74. icq_interests_keyword4 TEXT NOT NULL DEFAULT '',
  75. icq_moreInfo_birthDay INTEGER NOT NULL DEFAULT 0,
  76. icq_moreInfo_birthMonth INTEGER NOT NULL DEFAULT 0,
  77. icq_moreInfo_birthYear INTEGER NOT NULL DEFAULT 0,
  78. icq_moreInfo_gender INTEGER NOT NULL DEFAULT 0,
  79. icq_moreInfo_homePageAddr TEXT NOT NULL DEFAULT '',
  80. icq_moreInfo_lang1 INTEGER NOT NULL DEFAULT 0,
  81. icq_moreInfo_lang2 INTEGER NOT NULL DEFAULT 0,
  82. icq_moreInfo_lang3 INTEGER NOT NULL DEFAULT 0,
  83. icq_notes TEXT NOT NULL DEFAULT '',
  84. icq_permissions_authRequired BOOLEAN NOT NULL DEFAULT false,
  85. icq_workInfo_address TEXT NOT NULL DEFAULT '',
  86. icq_workInfo_city TEXT NOT NULL DEFAULT '',
  87. icq_workInfo_company TEXT NOT NULL DEFAULT '',
  88. icq_workInfo_countryCode INTEGER NOT NULL DEFAULT 0,
  89. icq_workInfo_department TEXT NOT NULL DEFAULT '',
  90. icq_workInfo_fax TEXT NOT NULL DEFAULT '',
  91. icq_workInfo_occupationCode INTEGER NOT NULL DEFAULT 0,
  92. icq_workInfo_phone TEXT NOT NULL DEFAULT '',
  93. icq_workInfo_position TEXT NOT NULL DEFAULT '',
  94. icq_workInfo_state TEXT NOT NULL DEFAULT '',
  95. icq_workInfo_webPage TEXT NOT NULL DEFAULT '',
  96. icq_workInfo_zipCode TEXT NOT NULL DEFAULT '',
  97. FOREIGN KEY (aim_keyword1) REFERENCES aimKeyword (id),
  98. FOREIGN KEY (aim_keyword2) REFERENCES aimKeyword (id),
  99. FOREIGN KEY (aim_keyword3) REFERENCES aimKeyword (id),
  100. FOREIGN KEY (aim_keyword4) REFERENCES aimKeyword (id),
  101. FOREIGN KEY (aim_keyword5) REFERENCES aimKeyword (id)
  102. );
  103. INSERT INTO users (identScreenName,
  104. displayScreenName,
  105. authKey,
  106. strongMD5Pass,
  107. weakMD5Pass,
  108. confirmStatus,
  109. emailAddress,
  110. regStatus,
  111. isICQ,
  112. aim_firstName,
  113. aim_lastName,
  114. aim_middleName,
  115. aim_maidenName,
  116. aim_country,
  117. aim_state,
  118. aim_city,
  119. aim_nickName,
  120. aim_zipCode,
  121. aim_address,
  122. aim_keyword1,
  123. aim_keyword2,
  124. aim_keyword3,
  125. aim_keyword4,
  126. aim_keyword5,
  127. icq_affiliations_currentCode1,
  128. icq_affiliations_currentCode2,
  129. icq_affiliations_currentCode3,
  130. icq_affiliations_currentKeyword1,
  131. icq_affiliations_currentKeyword2,
  132. icq_affiliations_currentKeyword3,
  133. icq_affiliations_pastCode1,
  134. icq_affiliations_pastCode2,
  135. icq_affiliations_pastCode3,
  136. icq_affiliations_pastKeyword1,
  137. icq_affiliations_pastKeyword2,
  138. icq_affiliations_pastKeyword3,
  139. icq_basicInfo_address,
  140. icq_basicInfo_cellPhone,
  141. icq_basicInfo_city,
  142. icq_basicInfo_countryCode,
  143. icq_basicInfo_emailAddress,
  144. icq_basicInfo_fax,
  145. icq_basicInfo_firstName,
  146. icq_basicInfo_gmtOffset,
  147. icq_basicInfo_lastName,
  148. icq_basicInfo_nickName,
  149. icq_basicInfo_phone,
  150. icq_basicInfo_publishEmail,
  151. icq_basicInfo_state,
  152. icq_basicInfo_zipCode,
  153. icq_interests_code1,
  154. icq_interests_code2,
  155. icq_interests_code3,
  156. icq_interests_code4,
  157. icq_interests_keyword1,
  158. icq_interests_keyword2,
  159. icq_interests_keyword3,
  160. icq_interests_keyword4,
  161. icq_moreInfo_birthDay,
  162. icq_moreInfo_birthMonth,
  163. icq_moreInfo_birthYear,
  164. icq_moreInfo_gender,
  165. icq_moreInfo_homePageAddr,
  166. icq_moreInfo_lang1,
  167. icq_moreInfo_lang2,
  168. icq_moreInfo_lang3,
  169. icq_notes,
  170. icq_permissions_authRequired,
  171. icq_workInfo_address,
  172. icq_workInfo_city,
  173. icq_workInfo_company,
  174. icq_workInfo_countryCode,
  175. icq_workInfo_department,
  176. icq_workInfo_fax,
  177. icq_workInfo_occupationCode,
  178. icq_workInfo_phone,
  179. icq_workInfo_position,
  180. icq_workInfo_state,
  181. icq_workInfo_webPage,
  182. icq_workInfo_zipCode)
  183. SELECT identScreenName,
  184. displayScreenName,
  185. authKey,
  186. strongMD5Pass,
  187. weakMD5Pass,
  188. confirmStatus,
  189. emailAddress,
  190. regStatus,
  191. isICQ,
  192. '',
  193. '',
  194. '',
  195. '',
  196. '',
  197. '',
  198. '',
  199. '',
  200. '',
  201. '',
  202. NULL,
  203. NULL,
  204. NULL,
  205. NULL,
  206. NULL,
  207. icq_affiliations_currentCode1,
  208. icq_affiliations_currentCode2,
  209. icq_affiliations_currentCode3,
  210. icq_affiliations_currentKeyword1,
  211. icq_affiliations_currentKeyword2,
  212. icq_affiliations_currentKeyword3,
  213. icq_affiliations_pastCode1,
  214. icq_affiliations_pastCode2,
  215. icq_affiliations_pastCode3,
  216. icq_affiliations_pastKeyword1,
  217. icq_affiliations_pastKeyword2,
  218. icq_affiliations_pastKeyword3,
  219. icq_basicInfo_address,
  220. icq_basicInfo_cellPhone,
  221. icq_basicInfo_city,
  222. icq_basicInfo_countryCode,
  223. icq_basicInfo_emailAddress,
  224. icq_basicInfo_fax,
  225. icq_basicInfo_firstName,
  226. icq_basicInfo_gmtOffset,
  227. icq_basicInfo_lastName,
  228. icq_basicInfo_nickName,
  229. icq_basicInfo_phone,
  230. icq_basicInfo_publishEmail,
  231. icq_basicInfo_state,
  232. icq_basicInfo_zipCode,
  233. icq_interests_code1,
  234. icq_interests_code2,
  235. icq_interests_code3,
  236. icq_interests_code4,
  237. icq_interests_keyword1,
  238. icq_interests_keyword2,
  239. icq_interests_keyword3,
  240. icq_interests_keyword4,
  241. icq_moreInfo_birthDay,
  242. icq_moreInfo_birthMonth,
  243. icq_moreInfo_birthYear,
  244. icq_moreInfo_gender,
  245. icq_moreInfo_homePageAddr,
  246. icq_moreInfo_lang1,
  247. icq_moreInfo_lang2,
  248. icq_moreInfo_lang3,
  249. icq_notes,
  250. icq_permissions_authRequired,
  251. icq_workInfo_address,
  252. icq_workInfo_city,
  253. icq_workInfo_company,
  254. icq_workInfo_countryCode,
  255. icq_workInfo_department,
  256. icq_workInfo_fax,
  257. icq_workInfo_occupationCode,
  258. icq_workInfo_phone,
  259. icq_workInfo_position,
  260. icq_workInfo_state,
  261. icq_workInfo_webPage,
  262. icq_workInfo_zipCode
  263. FROM users_old;
  264. DROP TABLE users_old;