RC\\\'v7.uaι{3@aûN aOzpV\" ;!ˊ W/zǽ )$Qg*^j\rS_c4ZFX~Odc˹\0\0 \0IDATT4}5Q=Q;B \Z;LѮ1LDs9pl v@u7:;9\"!6eh9PQ^(/Μ~2_y=IВ#Rڻ1ZQ!joQ,\'\Zi{Ydh4j)-5V捥;gF58Ag4jQGpw8T5.A\ZM)#WC8=Ι9xڱxZ;Wanvq`)|\ZILh-MMOkHΆ4Ijm-j0mS(FGWVWF$DW#nFFVZʐ}ByT \\ײ<ܬЁΘ1a\rHlfZ-0z2O2SQ=^nn6exȣ\0| Pb*$@_\r:#\rc0qh[W/f.\\XmWwε}2(Nh#3z\n\Z\n^t]<;\0tIټ3n|MqkZy\\Ks,p:aG!lr-75 a\"{0@7vwDG&h:P_`k;p8v<0\\.o<ز2)ѮGO]}=\n Zz/l=tpp A*sl\"k5D}1;K㝭wABS4dIH4&0K/NgUDݝwJnp23CH~*(\Z\0X \Z;돁\\\0DChZʥ٨^>hlMਸt,\nVFQyLLQȅ!2;aX^;8jb=fN=pjmgpkrk\'W7n,lل7GA<ծ\0Ń#fA>mO3W_PgVbԝqiV\"!X@U\\sg@F~d\\OBD^~-QTS!\"%=\0L0q#ea8:Vbopܝ`O9x2FZv!*d,E6N>DDe!Dѫ0\0\Z=zgѣGAu]s\Z@M]u;`=\noQXYX=z}@p@as++X~_54<-\",.R Ϊ\Z+#E|z܌^D\"9-?S/\\²>q.KϳYGD#⇌\'&J]o^m])ޞKw\'+Epޕ023\"YBT7-E-sZۺ05bYd5\roQR)ʗ%a=gz{ Cj&Sx251===5jӯ@íQ3 Q:}gQ^ ($ǯw0THG@{c\'>%shrdZ\Z].Y_[M /] axHPq\"qʐ7ե<0C+1)E,\Z4KQ#ܢZRY/≨y&4rDUMFkp/,f\nvƳ儌^\Z=}Z00fɻ DCDvbDi ǭ+*P\0I${wPCJ$rZ~ \\dvG\Zܓ蹥Rm!z;D ELJ4/!=A?C0!Bd)&BbD]y..^:]mAeE\rmۊӧT/j!(푀ԂbU~Ɗ\rY&M`QgY[`!2?H zJ}44]!F)z~V[\Z겧SCg`|XuZq߯6gi/ pyZb]W@;lw/.+\ZÙGVYᧅL-ğ($ 1A\"]hU5EƓFZ@f.EoMj3[,rӌ\"TSSrZn\ZJJ\"h^V5+D#щ;ʬF7)pܩG؈!jV$Cr94nXJ9߸G{6؎c\"J{ئhm/$HJ!G$D̐E}=N.)`mS+ccUX2]!$ |cWVLL\rdUDM^Z5 \"\0lm z~~ĿУeVC$-؋\0mk2I0=2xب<{)]rVydYH؊1WU/\\sD{e4(\"N^,48Ϣ?UWR{e\Z&\n(wM\'>VX`mCu4Ts?S\'ZD\ne xX4)o& cD++QuZatPXn9|V$m&BԎP\"}D*ONJ>%u>?3;{{ukv.[ak&CQU`ۖ4Hg,UңgB,=}:ZSϣ/`a劰atWҨQʖt5KpMEDDd[v/c)Vba\ZHOpwxm- ^Z~E͉KML*T6eՇԐ!\'i\'~X^(1:oq+˳3^]Wm5ꁧD׆(\rTyr>׳pjj\'d̍jitApY>[cP%\"fMB\'ՖU-Hq[eȑ}hmcph[;gAth!\nK$FV+.ntyNp|{|{T`G$E?`ab\\@ecۏ>Gw@}a뷁\Z\Z㫰9\nɓm)\"S֙gFϜ]}|zԙхgN-GgFFzz?@rᖍKu6:ykuctO{\ZELP%R4?>qo״ʷzB,,KXjk1DUٶe\0~u\\=.#խn=Z}珬l7ubTD҉=#}zz{5Zi}~v~NDDCI,+0 \ZgJb~@d\'zNkٙ3-\'FϜ91TϩgN=:,w넉/3உhנdta\'G/Z\"n0ztkV-yDSM`v-M\rm 3D6),SKiyqec[rK[M 8-B/UH 肹nh]a!yʄ\0C\'sӝN6{Cq4j4[< %FÀ|{{^BmqV걱1(~j->揮xW&@y]\rj(cbUW:X!Q泽1Ղh%3n[_cYѬd`INQK0zNB$iU1P`K\'V#`0\Za9\\Z9a!۞QYaۤOfXigc\\,t~]U\Z/DsGh_\0\"3[C{[CUu֪6Aܪz>5־ڃ?\'CU(I[t ZJyX%R,+(\"ĚM_f J`\ZYzԦ)Xjl)}un?lhG3$%;p`3:aVl2r*!<6חK;NmTN\nmUeU4;tHcƾ@zҁ/\n*o\'7ʉe?_Z%,͓pߓzO͐ ŲXIK+ڟD\"J<ciMᏄBACJܦ¯[7fpVE\"10Ɗ|AY#!neӲRۼ0CG˨mly~4I&ʁT;rSM.NfhoݚEJC_2xgQ5\\a5DvR!D]LD/he3D:$YI,&r4\'a0L;+?;C!x7D|fdt\Z+@EԗZRAU}|.hq*SKZ!qGѿ\' D\"iYKX\\{l q(Dsrl_`̡w@-Ý\nZ-ߢ6X|=~SX_5~̟Dy\0Ll\ruVU-T}Gz| c֪!Q\ZSԤnl-\ZLS{aqwaݕgK9 ri^x̌DD^r%a-=^)B\"Zj!H}ɚz&\\t#hO@ľR!uv{AF[\0pD8q~GŇȗ3aQg2?\0ncZ|BԹ۲pDѷvO VVS LBkvrJz&ؒ%Jf$cŷjFq.\0^~9`3]Iﲫ\'P䦿뢕Ϧ6>N_Tv7|X) ?y49\Z߇\"ϡq,xr);ip͛;KqEL-\'Nt{D@Y*FV(/ :\Z $1cIxje:pשv/Bظ3E_`C6vْ`bDvNcfV#SMZr-Y%6놨G9a0.]t{.) SMZ|\0h\0QB4aFCgG n6\\]\")mv._F`rx@kּy@$[e3t5˂(>|܂ԩN\"9揿Z8h@o~\"@!2EQ3f\Z(\"x2K7L8U\Zsg-aYXhjZyƾj ()zN\"F㫓p2|}=8!RUʍ6\'n \Ziy1È\0ȵKp5T4^VjQU,T1 řQl\0LGJKvCt8JќB4VGb{C{X;D~\\˽SU\0\"ǪN\rJn=^_m?k~V̞7L\"9\rU*74:tj)C24ٴ)tmq&t[G}QJ ң]Fpex\0Fa{i)*%U֣ik}x韋9&W9pXpI*z`f[m/v\0R㈗pB!D\ZBZWfISE>Rg\0$?̗GmZYr lk&?y1Q!.;,ҭӵch_.&H\".>.Nf̲rC02 4./RJz:U7UW\"tex{Ƨ)\"1^ayMD2\\%CZ˦Z.D|UV:B\",8~LȁWvzļ@|\'1(尡{c\r2۽\')aUU)e9 +2<Yd)eQd^汢Jf:0:N;h<Η1V_,@z\"ܢvGr2twjs3A6W\"A4TE\\.k%|iݯ̷45[f(d.jZjk^P>~KѰ\r9ȠD\\+[iL\"EÜHP31\0N?0.H~Y[H{LKY\"ިw۫RcD Dmc=<$hsDz1q^LL8BʲDK- AW.7.Wv-|KՆօݥ͋Ņږ GXmkS{zZ{|,&x\"C$o﮺D\"΅ѾX#z[ bmDOۇHjao,%)h* :ɲZ&6i \ZP`1\"y@ĭf7o=Cd
.^v+/]E6gI\"9\n{56x\nQ!C-BQ>Dl$gمXtlkg5с-c@\0nŎ\0(B3\0pr@VUչl{2IBT/M5cBƜ:\r)nuEYڏYlE{Zb5[AL7֒!(tMv+.^&~]3A5D4n!rS\",hj]sV\ZjV?DÒ\"ɞJދg܆Rg[ccCɻ TgkzXӂh܂z>s3/5]v6v풭=|!\ZEl:3;`!$#x^X3b-b* teѳj|$e|V̎Sk\Z!!2 1Id~\n\\Y|tF1{AΆ{;4Z6!DNs?!ѡxBj@D\"mQaQtqvlvbK,&dch-(bnϒlUXH5Kt8Fl+66H\"IM\"e6\n]Y\"EbYI]8#kj^st#N]\02I)¹ V:A%Yjdʶ!Kk\r|lbݽRd8D!{}qޖ<\nr|p8c3E!D!G}XD$ii E\"ODEf93٘:wю75lhE/7~\"\0)ڄ\"4wH-YɎj~!ڇ\"h505oA$ˡDv|np} 30Z4ƦǤP(f6i}/X&H}\0\"b D(eg:\Zt$AE@({||\\_\n;3Q=/wʼn<&}V=wq\Zi`b[jݳ.H `dmbRFfue2vwr-P h[C#ĸ~mD@jfZhIFqI$nID)ǐ=/\"X&E *Dk$eJ\"FeUv3xS:3%31r\'hTҪ%)D\"φQC聏DP?nw.0D=?$DV(-hֵS%{@#$%y!D\"-!QV\"JjU9DM\rHo`$FQ D@ӓI=E?i- zY\'jQٙȋa80~^ڗ.4>3]2%҂ku&3Ir,j\"eI={Q1Pgt$R,e`qW깃E2q^ws0CFCE.ʬz2\rLqT$_\"E}d4ۯI(NP7փDwI=)mgn7Utezjjj1n6Voq[8Q\0s4.7m\Z`~otCAW:{0YCxhzZDMü&o[XSXu3$~?)j)AJP6/AhMU{7\rw8\nQ\ZS6S`2i-Ct5/\\=q+F#8kTv=3L`\'q9\0D}L\"}(.bcպ%͵*\r\"Wqr6DW.53Ei $36@|ge᭶66\"3eLGqs/@=Gg4щ \0X>\n:;ըIGQ^ĄFd5䳃S&]HɁ3\'D(44IIfEqL#(F \ZpkHN[\'l{Y]\\\\lmX~Lo2Pb\n.bWhU\ZflFsSԊ8XD| Q(2tfd(宍miSv,Kp|Q\\c2cpÖGW\0A4^\rb(1RS=\ZOxx4Q{i/fmXOJYO)JL?\0\nGZP5m\Ze(x uej_ykn\'8DhG$9b-#˱[CNHXE\'\'^G bs\";jz2 ΜFYq\Z !|x_IT#(B㷳 X ^me%aߪ&t&ci>[A.痿O]y\"&\r1o*$_[TSLÙւ;H|X1ӖcAcYt5\0Dy\Z)\Z\"jԣE4N:S=\\|%&z[b\ZXZrx*@Z/\n8(.7\rMAy>3̈́\nX#dɓCyv8tj\"!U\'&O\'\'O\'kD \rTl?=bإ *P2\'X} \Zt6jKKV1sȆ>LB\r1iYۈqBDj!lFk1sCDC\r8/ܝ֚. gCnD*Ds \nRKϢhWxU*DCCkAmxV39\rLP\"DROCt*z Ks*V4)a} kvx@$U壑H4ʰ(sh88j? Ή:Q\r:(E,%a\nѕgEP 2v̝9SV!Ge#ɂL*\"p|\ZS:O(eD$zLh9}בkYCES\"DP:]}s]c>3$7\0q/`ѓ4HD7ac--\n8=|h\Z3+xYK\\pta B~8¿gJR_L1s?ᬌS(qwuhKu@=yVg5k4d!vcϭ~y0yBd\"\\1E#u\ZUrƇ-Lz=xԆv!&8)\"ُ2^&ʥhJT\":gT3BQXGɑl)1hW28E,AU.O+:A\"vEg4d :s o.\Z\">80\'?d\'Ru3*yvQU$7\rm;bNJd]mCV9u`ҘY%鑴sx>EE*v~?@(ҙM0:\ne!)_\\a@:6&A\"$ff=Mբ@@ZJ\rIw ֶ\Z6Do!!HYɕ+P_:V1ZS\"J_A_ɉY_0ZE`?w3ህ_~OMQ2蠃ϛGLmђ5%l$Q,tanySN&j9\"+ךZU2ۇ4D\\̤\\\Zmo?\"=2Q9X\'@DWV\\B*H5\"\r|*>1.]><=Ar!woA,ļ)QO7*C\r$itJb䀓\r(W-gp\\>,Mi:ʫy|a|t03ۀ\"(BS+0D9\\-0am YTDt,F\"CwTP$iǴLpKs}u;wA[rN9@GC*6b0Eh5!HMɚD4\0Q^+ 5 &|^=?Qe}\\76Ztd2Apci=cp> wt@5(J#NVؖbk\Z:3LD+@n D^萴^+Lf{[; 6Ia2~6y|o*i(Bt/]!X9H2kCOۦ(0:f.ʢ^ӅvTb :9\\ᓔz=Zs]b.lԟ1z9NQ+L)BQ2̧ZFiJr!9R&~QC@T༺..-#z*>|&o`֙牺 3_aLOjʟ|:_If~6 \"G a\rlIv>.]3!:D=O0xCRJ=f7#}~\"Y=}F˨KIaސ1\n#D[v+qV~ex4OOsLm˥S`EY5j7]H#\nݬH{WVҪ\"Oz@\Z|.L/C9pco`w杽/y7n\"D[{7n|n~@(\"&\ZGFHL-~v9 _]\'V5W4W)Q{F\\.+<_\ZDO!S{|T+^\0z]=--mߛ+(ܦK)\'hvz\\J#[\\%:0o;5@qF7HWԊTۭG{u\'wX\nAĬ|?go38iҼ?xЇ?߄;?Bn_/,\"]EIJPC0̥鳒5TA\"DpCG%^V \'32uڼoq sF?g}]@ 330@T|zoi@ˍ\Z\Z\Z\Z/vKPb,t0+ɍl1t>\0US+P{%}>PG %Q>߱\ZL\07+G٧5a Sw@̟h>0W7n$*2< )ș352 *g\0:dN˨ի .`J+\"qQ=zףTYiV\ZrEz}Ki\"{#;\0Fj8cy\ZJ\rE|!b?9FjlB=z\"D>p4u`6NLSfSsmɧO}l~4濁(D1pȽRzA#Lև(x\0D,mv*%R=(t z{@4\\d D=}|oXN+}i\r7gVl|.^ljmkkEf||&UN\"CXUG4@utg^n6~^чԉd?)~_CBl&G@s\rv$h}kt9Ə\'u4\'~4Gf-\\qPVy\Z| |A:6?GDSްf\0*q1z5W(vijC̆+MaAZABy\Z-?3|ؘ5{߃Qkƛkk[B4=\"kNK[BDV2#(i`G\ZupΛVf-4ѝ̯>@ ߚ%vɷ>03O[777!D5~ps>Λ$Xذ*}Ґ.n|1R]};\\UL|Z)@:@EBz.^p4^}` n7M+b^Q^f:dGM\\5\r.RfmpDwYlY7ߌ#no~ӏO}潑L큁4?_L~|N \0WJzppxc(uO3ۼ=#^qJ)Ӕ$C$xv>|opʈ\"H5^7\0\Z\0^}؋×5\"˺װ`!}`j6\'qP| drnuhChݯfCdͯ~l/3O1Foܸy\' >w9_ qNwbsIsLZ&TǮCьlW\r\rnT\\Ec~R54=$ĉ\"oJ]K昰X#&P6\\1|\0$$+.5ʘGeVTUfMe 7<]!I97ݛ7n6pc`&*o{I3>0rsFo~[:BS2ؾs lAΧj\Z\\A7,DE_FN0T\"!RM1lʅ R$Q̩RIp$7_KנMBۖ$:ܓʣG)&Mѩhџ))#O?Aoxr@1;q;\0w;,H>|G~x/X\ZCC@ ZȌ~.A4w{ܝ5#tCtbZ}1jhZf4\r\rn\rSydp?ۗqAn\\]ޕ1+U\Z.Wր)jZ]Z;;6hn^$7ĕkغ1ֹaGs\0tz.*_Ϫ!Qjo{:32fgff+3R3zl95u;\0ezUi\\a)<0Ubv)xOm+sh$xw{L|B(x1]i}hP1[@4Hdilg=\\XQi{@{\'hv=z\rH/SJOU+3$mVe29}VI!r<\\%!`d\ZG{IG9.v)GQ\'=<ʃ#D\n\"qd3:F$Y0\0Q\Z=]Qi Pe8LinH\0T9b;RHQ_9(9Uso=<\0?F{Pyds+K8+6KcEbdb,Dp \";$}X5I%&DL/(j>3ӫCt)i\"tA䊿gbn]/f>gly28@t4r8c~#e/q(Ek0oyk#txHWO~bi}:~T8*@U~4%!:8C B(f^({W0D-\\A\"rmI0@W_S37²ŌtI=탍(KiK 1ʹrWje3&{k@\\PF2(;4<C>Bt`Nu)lA9Y-$A0>HkX;1RLmֲ\Z%)ndAےs}vl\Z(vS>ywu3\"Z!B]@bME#2kY\"@\\4x\ZciŲ̪Wt[UU>}\\C\"TR1 1sեu]2b*Dt^:ODvc徽\"U#!/͆10\rN´\rDK/*C*gyOoQ-llXVDT+ĎHHE]gt@3XdVU)BgZe[9\0\0\0\0IENDB`');
/*!40000 ALTER TABLE `filecontent` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `filemodel`
--
DROP TABLE IF EXISTS `filemodel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `filemodel` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`size` int(11) DEFAULT NULL,
`type` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`filecontent_id` int(11) unsigned DEFAULT NULL,
`relatedmodel_id` int(11) unsigned DEFAULT NULL,
`relatedmodel_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `filemodel`
--
LOCK TABLES `filemodel` WRITE;
/*!40000 ALTER TABLE `filemodel` DISABLE KEYS */;
INSERT INTO `filemodel` VALUES (1,'200x50.gif',449,'image/gif',3,1,NULL,NULL),(2,'200x200.gif',712,'image/gif',4,2,NULL,NULL),(3,'580x180.gif',1898,'image/gif',5,3,NULL,NULL),(4,'googleMaps.png',39873,'image/png',6,4,NULL,NULL);
/*!40000 ALTER TABLE `filemodel` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamebadge`
--
DROP TABLE IF EXISTS `gamebadge`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamebadge` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`grade` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamebadge`
--
LOCK TABLES `gamebadge` WRITE;
/*!40000 ALTER TABLE `gamebadge` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamebadge` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamecoin`
--
DROP TABLE IF EXISTS `gamecoin`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamecoin` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`value` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamecoin`
--
LOCK TABLES `gamecoin` WRITE;
/*!40000 ALTER TABLE `gamecoin` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamecoin` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamecollection`
--
DROP TABLE IF EXISTS `gamecollection`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamecollection` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamecollection`
--
LOCK TABLES `gamecollection` WRITE;
/*!40000 ALTER TABLE `gamecollection` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamecollection` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamelevel`
--
DROP TABLE IF EXISTS `gamelevel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamelevel` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamelevel`
--
LOCK TABLES `gamelevel` WRITE;
/*!40000 ALTER TABLE `gamelevel` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamelevel` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamenotification`
--
DROP TABLE IF EXISTS `gamenotification`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamenotification` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`serializeddata` text COLLATE utf8_unicode_ci,
`_user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamenotification`
--
LOCK TABLES `gamenotification` WRITE;
/*!40000 ALTER TABLE `gamenotification` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamenotification` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamepoint`
--
DROP TABLE IF EXISTS `gamepoint`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamepoint` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamepoint`
--
LOCK TABLES `gamepoint` WRITE;
/*!40000 ALTER TABLE `gamepoint` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamepoint` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamepointtransaction`
--
DROP TABLE IF EXISTS `gamepointtransaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamepointtransaction` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`value` int(11) DEFAULT NULL,
`createddatetime` datetime DEFAULT NULL,
`gamepoint_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `gamepoint_id` (`gamepoint_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamepointtransaction`
--
LOCK TABLES `gamepointtransaction` WRITE;
/*!40000 ALTER TABLE `gamepointtransaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamepointtransaction` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamereward`
--
DROP TABLE IF EXISTS `gamereward`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamereward` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`cost` int(11) DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`expirationdatetime` datetime DEFAULT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`quantity` int(11) DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamereward`
--
LOCK TABLES `gamereward` WRITE;
/*!40000 ALTER TABLE `gamereward` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamereward` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamereward_read`
--
DROP TABLE IF EXISTS `gamereward_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamereward_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `gamereward_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamereward_read`
--
LOCK TABLES `gamereward_read` WRITE;
/*!40000 ALTER TABLE `gamereward_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamereward_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamerewardtransaction`
--
DROP TABLE IF EXISTS `gamerewardtransaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamerewardtransaction` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`redemptiondatetime` datetime DEFAULT NULL,
`quantity` int(11) DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
`transactions_gamereward_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamerewardtransaction`
--
LOCK TABLES `gamerewardtransaction` WRITE;
/*!40000 ALTER TABLE `gamerewardtransaction` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamerewardtransaction` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gamescore`
--
DROP TABLE IF EXISTS `gamescore`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gamescore` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gamescore`
--
LOCK TABLES `gamescore` WRITE;
/*!40000 ALTER TABLE `gamescore` DISABLE KEYS */;
/*!40000 ALTER TABLE `gamescore` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `globalmetadata`
--
DROP TABLE IF EXISTS `globalmetadata`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `globalmetadata` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`classname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializedmetadata` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_emaNssalc` (`classname`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `globalmetadata`
--
LOCK TABLES `globalmetadata` WRITE;
/*!40000 ALTER TABLE `globalmetadata` DISABLE KEYS */;
INSERT INTO `globalmetadata` VALUES (1,'ContactsModule','a:10:{s:17:\"designerMenuItems\";a:4:{s:14:\"showFieldsLink\";b:1;s:15:\"showGeneralLink\";b:1;s:15:\"showLayoutsLink\";b:1;s:13:\"showMenusLink\";b:1;}s:26:\"globalSearchAttributeNames\";a:4:{i:0;s:8:\"fullName\";i:1;s:8:\"anyEmail\";i:2;s:11:\"officePhone\";i:3;s:11:\"mobilePhone\";}s:13:\"startingState\";i:1;s:12:\"tabMenuItems\";a:1:{i:0;a:4:{s:5:\"label\";s:80:\"eval:Zurmo::t(\'ContactsModule\', \'ContactsModulePluralLabel\', $translationParams)\";s:3:\"url\";a:1:{i:0;s:17:\"/contacts/default\";}s:5:\"right\";s:19:\"Access Contacts Tab\";s:6:\"mobile\";b:1;}}s:24:\"shortcutsCreateMenuItems\";a:1:{i:0;a:4:{s:5:\"label\";s:82:\"eval:Zurmo::t(\'ContactsModule\', \'ContactsModuleSingularLabel\', $translationParams)\";s:3:\"url\";a:1:{i:0;s:24:\"/contacts/default/create\";}s:5:\"right\";s:15:\"Create Contacts\";s:6:\"mobile\";b:1;}}s:48:\"updateLatestActivityDateTimeWhenATaskIsCompleted\";b:1;s:46:\"updateLatestActivityDateTimeWhenANoteIsCreated\";b:1;s:55:\"updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived\";b:1;s:51:\"updateLatestActivityDateTimeWhenAMeetingIsInThePast\";b:1;s:15:\"startingStateId\";i:5;}');
/*!40000 ALTER TABLE `globalmetadata` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `imagefilemodel`
--
DROP TABLE IF EXISTS `imagefilemodel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `imagefilemodel` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`isshared` tinyint(1) unsigned DEFAULT NULL,
`width` int(11) DEFAULT NULL,
`height` int(11) DEFAULT NULL,
`inactive` tinyint(1) unsigned DEFAULT NULL,
`filemodel_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `imagefilemodel`
--
LOCK TABLES `imagefilemodel` WRITE;
/*!40000 ALTER TABLE `imagefilemodel` DISABLE KEYS */;
INSERT INTO `imagefilemodel` VALUES (1,0,200,50,0,1),(2,0,200,200,0,2),(3,0,580,180,0,3),(4,0,580,180,0,4);
/*!40000 ALTER TABLE `imagefilemodel` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `import`
--
DROP TABLE IF EXISTS `import`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `import` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`serializeddata` text COLLATE utf8_unicode_ci,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `import`
--
LOCK TABLES `import` WRITE;
/*!40000 ALTER TABLE `import` DISABLE KEYS */;
/*!40000 ALTER TABLE `import` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `item`
--
DROP TABLE IF EXISTS `item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`createddatetime` datetime DEFAULT NULL,
`modifieddatetime` datetime DEFAULT NULL,
`createdbyuser__user_id` int(11) unsigned DEFAULT NULL,
`modifiedbyuser__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `item`
--
LOCK TABLES `item` WRITE;
/*!40000 ALTER TABLE `item` DISABLE KEYS */;
INSERT INTO `item` VALUES (1,'[[regtime]]','[[regtime]]',NULL,NULL),(2,'[[regtime]]','[[regtime]]',1,1),(3,'[[regtime]]','[[regtime]]',1,1),(4,'[[regtime]]','[[regtime]]',1,1),(5,'[[regtime]]','[[regtime]]',1,1),(6,'[[regtime]]','[[regtime]]',1,1),(7,'[[regtime]]','[[regtime]]',1,1),(8,'[[regtime]]','[[regtime]]',1,1),(9,'[[regtime]]','[[regtime]]',1,1),(10,'[[regtime]]','[[regtime]]',1,1),(11,'[[regtime]]','[[regtime]]',1,1),(12,'[[regtime]]','[[regtime]]',1,1),(13,'[[regtime]]','[[regtime]]',1,1),(14,'[[regtime]]','[[regtime]]',1,1),(15,'[[regtime]]','[[regtime]]',1,1),(16,'[[regtime]]','[[regtime]]',1,1),(17,'[[regtime]]','[[regtime]]',1,1),(18,'[[regtime]]','[[regtime]]',1,1),(19,'[[regtime]]','[[regtime]]',1,1);
/*!40000 ALTER TABLE `item` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jobinprocess`
--
DROP TABLE IF EXISTS `jobinprocess`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobinprocess` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jobinprocess`
--
LOCK TABLES `jobinprocess` WRITE;
/*!40000 ALTER TABLE `jobinprocess` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobinprocess` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `joblog`
--
DROP TABLE IF EXISTS `joblog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `joblog` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`enddatetime` datetime DEFAULT NULL,
`isprocessed` tinyint(1) unsigned DEFAULT NULL,
`message` text COLLATE utf8_unicode_ci,
`startdatetime` datetime DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `joblog`
--
LOCK TABLES `joblog` WRITE;
/*!40000 ALTER TABLE `joblog` DISABLE KEYS */;
/*!40000 ALTER TABLE `joblog` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `kanbanitem`
--
DROP TABLE IF EXISTS `kanbanitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `kanbanitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` int(11) DEFAULT NULL,
`sortorder` int(11) DEFAULT NULL,
`kanbanrelateditem_item_id` int(11) unsigned DEFAULT NULL,
`task_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `kanbanitem`
--
LOCK TABLES `kanbanitem` WRITE;
/*!40000 ALTER TABLE `kanbanitem` DISABLE KEYS */;
/*!40000 ALTER TABLE `kanbanitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `marketinglist`
--
DROP TABLE IF EXISTS `marketinglist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `marketinglist` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`fromname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`fromaddress` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`anyonecansubscribe` tinyint(1) unsigned DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `marketinglist`
--
LOCK TABLES `marketinglist` WRITE;
/*!40000 ALTER TABLE `marketinglist` DISABLE KEYS */;
/*!40000 ALTER TABLE `marketinglist` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `marketinglist_read`
--
DROP TABLE IF EXISTS `marketinglist_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `marketinglist_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `marketinglist_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `marketinglist_read`
--
LOCK TABLES `marketinglist_read` WRITE;
/*!40000 ALTER TABLE `marketinglist_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `marketinglist_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `marketinglistmember`
--
DROP TABLE IF EXISTS `marketinglistmember`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `marketinglistmember` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`createddatetime` datetime DEFAULT NULL,
`modifieddatetime` datetime DEFAULT NULL,
`unsubscribed` tinyint(1) unsigned DEFAULT NULL,
`contact_id` int(11) unsigned DEFAULT NULL,
`marketinglist_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `contact_id` (`contact_id`),
KEY `marketinglist_id` (`marketinglist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `marketinglistmember`
--
LOCK TABLES `marketinglistmember` WRITE;
/*!40000 ALTER TABLE `marketinglistmember` DISABLE KEYS */;
/*!40000 ALTER TABLE `marketinglistmember` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `meeting`
--
DROP TABLE IF EXISTS `meeting`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `meeting` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`enddatetime` datetime DEFAULT NULL,
`processedforlatestactivity` tinyint(1) unsigned DEFAULT NULL,
`location` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`logged` tinyint(1) unsigned DEFAULT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`startdatetime` datetime DEFAULT NULL,
`activity_id` int(11) unsigned DEFAULT NULL,
`category_customfield_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `meeting`
--
LOCK TABLES `meeting` WRITE;
/*!40000 ALTER TABLE `meeting` DISABLE KEYS */;
/*!40000 ALTER TABLE `meeting` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `meeting_read`
--
DROP TABLE IF EXISTS `meeting_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `meeting_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `meeting_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `meeting_read`
--
LOCK TABLES `meeting_read` WRITE;
/*!40000 ALTER TABLE `meeting_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `meeting_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `meeting_read_subscription`
--
DROP TABLE IF EXISTS `meeting_read_subscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `meeting_read_subscription` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userid` int(11) unsigned NOT NULL,
`modelid` int(11) unsigned NOT NULL,
`modifieddatetime` datetime DEFAULT NULL,
`subscriptiontype` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userid_modelid` (`userid`,`modelid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `meeting_read_subscription`
--
LOCK TABLES `meeting_read_subscription` WRITE;
/*!40000 ALTER TABLE `meeting_read_subscription` DISABLE KEYS */;
/*!40000 ALTER TABLE `meeting_read_subscription` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `messagesource`
--
DROP TABLE IF EXISTS `messagesource`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messagesource` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`category` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`source` blob,
PRIMARY KEY (`id`),
UNIQUE KEY `sourceCategory` (`category`,`source`(767))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `messagesource`
--
LOCK TABLES `messagesource` WRITE;
/*!40000 ALTER TABLE `messagesource` DISABLE KEYS */;
/*!40000 ALTER TABLE `messagesource` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `messagetranslation`
--
DROP TABLE IF EXISTS `messagetranslation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messagetranslation` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`translation` blob,
`language` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
`messagesource_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sourceLanguageTranslation` (`messagesource_id`,`language`,`translation`(767))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `messagetranslation`
--
LOCK TABLES `messagetranslation` WRITE;
/*!40000 ALTER TABLE `messagetranslation` DISABLE KEYS */;
/*!40000 ALTER TABLE `messagetranslation` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `mission`
--
DROP TABLE IF EXISTS `mission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mission` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`duedatetime` datetime DEFAULT NULL,
`latestdatetime` datetime DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`reward` text COLLATE utf8_unicode_ci,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
`takenbyuser__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `mission`
--
LOCK TABLES `mission` WRITE;
/*!40000 ALTER TABLE `mission` DISABLE KEYS */;
/*!40000 ALTER TABLE `mission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `mission_read`
--
DROP TABLE IF EXISTS `mission_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mission_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `mission_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `mission_read`
--
LOCK TABLES `mission_read` WRITE;
/*!40000 ALTER TABLE `mission_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `mission_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `modelcreationapisync`
--
DROP TABLE IF EXISTS `modelcreationapisync`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `modelcreationapisync` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`servicename` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`modelid` int(11) unsigned NOT NULL,
`modelclassname` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`createddatetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `modelcreationapisync`
--
LOCK TABLES `modelcreationapisync` WRITE;
/*!40000 ALTER TABLE `modelcreationapisync` DISABLE KEYS */;
/*!40000 ALTER TABLE `modelcreationapisync` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `multiplevaluescustomfield`
--
DROP TABLE IF EXISTS `multiplevaluescustomfield`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `multiplevaluescustomfield` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`basecustomfield_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `basecustomfield_id` (`basecustomfield_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `multiplevaluescustomfield`
--
LOCK TABLES `multiplevaluescustomfield` WRITE;
/*!40000 ALTER TABLE `multiplevaluescustomfield` DISABLE KEYS */;
/*!40000 ALTER TABLE `multiplevaluescustomfield` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `named_securable_actual_permissions_cache`
--
DROP TABLE IF EXISTS `named_securable_actual_permissions_cache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `named_securable_actual_permissions_cache` (
`securableitem_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`permitable_id` int(11) unsigned NOT NULL,
`allow_permissions` tinyint(3) unsigned NOT NULL,
`deny_permissions` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`securableitem_name`,`permitable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `named_securable_actual_permissions_cache`
--
LOCK TABLES `named_securable_actual_permissions_cache` WRITE;
/*!40000 ALTER TABLE `named_securable_actual_permissions_cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `named_securable_actual_permissions_cache` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `namedsecurableitem`
--
DROP TABLE IF EXISTS `namedsecurableitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `namedsecurableitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`securableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_eman` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `namedsecurableitem`
--
LOCK TABLES `namedsecurableitem` WRITE;
/*!40000 ALTER TABLE `namedsecurableitem` DISABLE KEYS */;
/*!40000 ALTER TABLE `namedsecurableitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `note`
--
DROP TABLE IF EXISTS `note`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `note` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`occurredondatetime` datetime DEFAULT NULL,
`activity_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `note`
--
LOCK TABLES `note` WRITE;
/*!40000 ALTER TABLE `note` DISABLE KEYS */;
/*!40000 ALTER TABLE `note` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `note_read`
--
DROP TABLE IF EXISTS `note_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `note_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `note_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `note_read`
--
LOCK TABLES `note_read` WRITE;
/*!40000 ALTER TABLE `note_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `note_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `notification`
--
DROP TABLE IF EXISTS `notification`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notification` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`ownerhasreadlatest` tinyint(1) unsigned DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`notificationmessage_id` int(11) unsigned DEFAULT NULL,
`owner__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `notification`
--
LOCK TABLES `notification` WRITE;
/*!40000 ALTER TABLE `notification` DISABLE KEYS */;
INSERT INTO `notification` VALUES (1,'RemoveApiTestEntryScriptFile',NULL,18,1,1);
/*!40000 ALTER TABLE `notification` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `notificationmessage`
--
DROP TABLE IF EXISTS `notificationmessage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notificationmessage` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`htmlcontent` text COLLATE utf8_unicode_ci,
`textcontent` text COLLATE utf8_unicode_ci,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `notificationmessage`
--
LOCK TABLES `notificationmessage` WRITE;
/*!40000 ALTER TABLE `notificationmessage` DISABLE KEYS */;
INSERT INTO `notificationmessage` VALUES (1,NULL,'If this website is in production mode, please remove the app/test.php file.',19);
/*!40000 ALTER TABLE `notificationmessage` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `notificationsubscriber`
--
DROP TABLE IF EXISTS `notificationsubscriber`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notificationsubscriber` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`hasreadlatest` tinyint(1) unsigned DEFAULT NULL,
`person_item_id` int(11) unsigned DEFAULT NULL,
`relatedmodel_id` int(11) unsigned DEFAULT NULL,
`relatedmodel_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `notificationsubscriber`
--
LOCK TABLES `notificationsubscriber` WRITE;
/*!40000 ALTER TABLE `notificationsubscriber` DISABLE KEYS */;
/*!40000 ALTER TABLE `notificationsubscriber` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `opportunity`
--
DROP TABLE IF EXISTS `opportunity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `opportunity` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`closedate` date DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`probability` tinyint(11) DEFAULT NULL,
`stagemodifieddatetime` datetime DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
`account_id` int(11) unsigned DEFAULT NULL,
`amount_currencyvalue_id` int(11) unsigned DEFAULT NULL,
`stage_customfield_id` int(11) unsigned DEFAULT NULL,
`source_customfield_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `opportunity`
--
LOCK TABLES `opportunity` WRITE;
/*!40000 ALTER TABLE `opportunity` DISABLE KEYS */;
/*!40000 ALTER TABLE `opportunity` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `opportunity_project`
--
DROP TABLE IF EXISTS `opportunity_project`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `opportunity_project` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`opportunity_id` int(11) unsigned DEFAULT NULL,
`project_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_di_tcejorp_di_ytinutroppo` (`opportunity_id`,`project_id`),
KEY `di_ytinutroppo` (`opportunity_id`),
KEY `di_tcejorp` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `opportunity_project`
--
LOCK TABLES `opportunity_project` WRITE;
/*!40000 ALTER TABLE `opportunity_project` DISABLE KEYS */;
/*!40000 ALTER TABLE `opportunity_project` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `opportunity_read`
--
DROP TABLE IF EXISTS `opportunity_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `opportunity_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `opportunity_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `opportunity_read`
--
LOCK TABLES `opportunity_read` WRITE;
/*!40000 ALTER TABLE `opportunity_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `opportunity_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `opportunitystarred`
--
DROP TABLE IF EXISTS `opportunitystarred`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `opportunitystarred` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`basestarredmodel_id` int(11) unsigned DEFAULT NULL,
`opportunity_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `basestarredmodel_id_opportunity_id` (`basestarredmodel_id`,`opportunity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `opportunitystarred`
--
LOCK TABLES `opportunitystarred` WRITE;
/*!40000 ALTER TABLE `opportunitystarred` DISABLE KEYS */;
/*!40000 ALTER TABLE `opportunitystarred` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ownedsecurableitem`
--
DROP TABLE IF EXISTS `ownedsecurableitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ownedsecurableitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned DEFAULT NULL,
`owner__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `owner__user_id` (`owner__user_id`),
KEY `securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ownedsecurableitem`
--
LOCK TABLES `ownedsecurableitem` WRITE;
/*!40000 ALTER TABLE `ownedsecurableitem` DISABLE KEYS */;
INSERT INTO `ownedsecurableitem` VALUES (1,1,1),(2,2,1),(3,3,1),(4,4,1),(5,5,1),(6,6,1),(7,7,1);
/*!40000 ALTER TABLE `ownedsecurableitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `permission`
--
DROP TABLE IF EXISTS `permission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permission` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`permissions` tinyint(11) DEFAULT NULL,
`type` tinyint(11) DEFAULT NULL,
`permitable_id` int(11) unsigned DEFAULT NULL,
`securableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permission`
--
LOCK TABLES `permission` WRITE;
/*!40000 ALTER TABLE `permission` DISABLE KEYS */;
INSERT INTO `permission` VALUES (1,27,1,3,1),(2,27,1,3,2),(3,27,1,3,3),(4,27,1,3,4),(5,27,1,3,5),(6,27,1,3,6);
/*!40000 ALTER TABLE `permission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `permitable`
--
DROP TABLE IF EXISTS `permitable`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permitable` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `item_id` (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permitable`
--
LOCK TABLES `permitable` WRITE;
/*!40000 ALTER TABLE `permitable` DISABLE KEYS */;
INSERT INTO `permitable` VALUES (1,1),(2,2),(3,8),(4,17);
/*!40000 ALTER TABLE `permitable` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `person`
--
DROP TABLE IF EXISTS `person`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `person` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`department` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`firstname` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`jobtitle` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`lastname` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`mobilephone` varchar(24) COLLATE utf8_unicode_ci DEFAULT NULL,
`officephone` varchar(24) COLLATE utf8_unicode_ci DEFAULT NULL,
`officefax` varchar(24) COLLATE utf8_unicode_ci DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
`primaryaddress_address_id` int(11) unsigned DEFAULT NULL,
`primaryemail_email_id` int(11) unsigned DEFAULT NULL,
`title_customfield_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ownedsecurableitem_id` (`ownedsecurableitem_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `person`
--
LOCK TABLES `person` WRITE;
/*!40000 ALTER TABLE `person` DISABLE KEYS */;
INSERT INTO `person` VALUES (1,NULL,'Super',NULL,'User',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,NULL,'System',NULL,'User',NULL,NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `person` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `personwhohavenotreadlatest`
--
DROP TABLE IF EXISTS `personwhohavenotreadlatest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `personwhohavenotreadlatest` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`person_item_id` int(11) unsigned DEFAULT NULL,
`mission_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `personwhohavenotreadlatest`
--
LOCK TABLES `personwhohavenotreadlatest` WRITE;
/*!40000 ALTER TABLE `personwhohavenotreadlatest` DISABLE KEYS */;
/*!40000 ALTER TABLE `personwhohavenotreadlatest` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `perusermetadata`
--
DROP TABLE IF EXISTS `perusermetadata`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `perusermetadata` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`classname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializedmetadata` text COLLATE utf8_unicode_ci,
`_user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `perusermetadata`
--
LOCK TABLES `perusermetadata` WRITE;
/*!40000 ALTER TABLE `perusermetadata` DISABLE KEYS */;
/*!40000 ALTER TABLE `perusermetadata` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `policy`
--
DROP TABLE IF EXISTS `policy`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `policy` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`modulename` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`permitable_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `policy`
--
LOCK TABLES `policy` WRITE;
/*!40000 ALTER TABLE `policy` DISABLE KEYS */;
/*!40000 ALTER TABLE `policy` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `portlet`
--
DROP TABLE IF EXISTS `portlet`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `portlet` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`column` int(11) DEFAULT NULL,
`position` int(11) DEFAULT NULL,
`layoutid` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`viewtype` text COLLATE utf8_unicode_ci,
`serializedviewdata` text COLLATE utf8_unicode_ci,
`collapsed` tinyint(1) unsigned DEFAULT NULL,
`_user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `portlet`
--
LOCK TABLES `portlet` WRITE;
/*!40000 ALTER TABLE `portlet` DISABLE KEYS */;
/*!40000 ALTER TABLE `portlet` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`quantity` int(11) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`pricefrequency` int(11) DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
`account_id` int(11) unsigned DEFAULT NULL,
`contact_id` int(11) unsigned DEFAULT NULL,
`opportunity_id` int(11) unsigned DEFAULT NULL,
`producttemplate_id` int(11) unsigned DEFAULT NULL,
`stage_customfield_id` int(11) unsigned DEFAULT NULL,
`sellprice_currencyvalue_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product`
--
LOCK TABLES `product` WRITE;
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
/*!40000 ALTER TABLE `product` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_productcategory`
--
DROP TABLE IF EXISTS `product_productcategory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_productcategory` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(11) unsigned DEFAULT NULL,
`productcategory_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_di_yrogetactcudorp_di_tcudorp` (`product_id`,`productcategory_id`),
KEY `di_tcudorp` (`product_id`),
KEY `di_yrogetactcudorp` (`productcategory_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_productcategory`
--
LOCK TABLES `product_productcategory` WRITE;
/*!40000 ALTER TABLE `product_productcategory` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_productcategory` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `product_read`
--
DROP TABLE IF EXISTS `product_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `product_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `product_read`
--
LOCK TABLES `product_read` WRITE;
/*!40000 ALTER TABLE `product_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `product_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `productcatalog`
--
DROP TABLE IF EXISTS `productcatalog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `productcatalog` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `productcatalog`
--
LOCK TABLES `productcatalog` WRITE;
/*!40000 ALTER TABLE `productcatalog` DISABLE KEYS */;
/*!40000 ALTER TABLE `productcatalog` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `productcatalog_productcategory`
--
DROP TABLE IF EXISTS `productcatalog_productcategory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `productcatalog_productcategory` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`productcatalog_id` int(11) unsigned DEFAULT NULL,
`productcategory_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_di_yrogetactcudorp_di_golatactcudorp` (`productcatalog_id`,`productcategory_id`),
KEY `di_golatactcudorp` (`productcatalog_id`),
KEY `di_yrogetactcudorp` (`productcategory_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `productcatalog_productcategory`
--
LOCK TABLES `productcatalog_productcategory` WRITE;
/*!40000 ALTER TABLE `productcatalog_productcategory` DISABLE KEYS */;
/*!40000 ALTER TABLE `productcatalog_productcategory` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `productcategory`
--
DROP TABLE IF EXISTS `productcategory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `productcategory` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`productcategory_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `productcategory`
--
LOCK TABLES `productcategory` WRITE;
/*!40000 ALTER TABLE `productcategory` DISABLE KEYS */;
/*!40000 ALTER TABLE `productcategory` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `productcategory_producttemplate`
--
DROP TABLE IF EXISTS `productcategory_producttemplate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `productcategory_producttemplate` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`productcategory_id` int(11) unsigned DEFAULT NULL,
`producttemplate_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_di_etalpmettcudorp_di_yrogetactcudorp` (`productcategory_id`,`producttemplate_id`),
KEY `di_yrogetactcudorp` (`productcategory_id`),
KEY `di_etalpmettcudorp` (`producttemplate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `productcategory_producttemplate`
--
LOCK TABLES `productcategory_producttemplate` WRITE;
/*!40000 ALTER TABLE `productcategory_producttemplate` DISABLE KEYS */;
/*!40000 ALTER TABLE `productcategory_producttemplate` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `producttemplate`
--
DROP TABLE IF EXISTS `producttemplate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `producttemplate` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`status` int(11) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`pricefrequency` int(11) DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`sellpriceformula_id` int(11) unsigned DEFAULT NULL,
`cost_currencyvalue_id` int(11) unsigned DEFAULT NULL,
`listprice_currencyvalue_id` int(11) unsigned DEFAULT NULL,
`sellprice_currencyvalue_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `producttemplate`
--
LOCK TABLES `producttemplate` WRITE;
/*!40000 ALTER TABLE `producttemplate` DISABLE KEYS */;
/*!40000 ALTER TABLE `producttemplate` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `project`
--
DROP TABLE IF EXISTS `project`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`status` int(11) DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `project`
--
LOCK TABLES `project` WRITE;
/*!40000 ALTER TABLE `project` DISABLE KEYS */;
/*!40000 ALTER TABLE `project` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `project_read`
--
DROP TABLE IF EXISTS `project_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `project_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `project_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `project_read`
--
LOCK TABLES `project_read` WRITE;
/*!40000 ALTER TABLE `project_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `project_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `projectauditevent`
--
DROP TABLE IF EXISTS `projectauditevent`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projectauditevent` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime DEFAULT NULL,
`eventname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`_user_id` int(11) unsigned DEFAULT NULL,
`project_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `projectauditevent`
--
LOCK TABLES `projectauditevent` WRITE;
/*!40000 ALTER TABLE `projectauditevent` DISABLE KEYS */;
/*!40000 ALTER TABLE `projectauditevent` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `projectstarred`
--
DROP TABLE IF EXISTS `projectstarred`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projectstarred` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`basestarredmodel_id` int(11) unsigned DEFAULT NULL,
`project_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `basestarredmodel_id_project_id` (`basestarredmodel_id`,`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `projectstarred`
--
LOCK TABLES `projectstarred` WRITE;
/*!40000 ALTER TABLE `projectstarred` DISABLE KEYS */;
/*!40000 ALTER TABLE `projectstarred` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role`
--
DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `role` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`role_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_eman` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role`
--
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedcalendar`
--
DROP TABLE IF EXISTS `savedcalendar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedcalendar` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`location` text COLLATE utf8_unicode_ci,
`moduleclassname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`startattributename` text COLLATE utf8_unicode_ci,
`endattributename` text COLLATE utf8_unicode_ci,
`serializeddata` text COLLATE utf8_unicode_ci,
`timezone` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`color` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedcalendar`
--
LOCK TABLES `savedcalendar` WRITE;
/*!40000 ALTER TABLE `savedcalendar` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedcalendar` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedcalendar_read`
--
DROP TABLE IF EXISTS `savedcalendar_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedcalendar_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `savedcalendar_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedcalendar_read`
--
LOCK TABLES `savedcalendar_read` WRITE;
/*!40000 ALTER TABLE `savedcalendar_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedcalendar_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedcalendarsubscription`
--
DROP TABLE IF EXISTS `savedcalendarsubscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedcalendarsubscription` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`color` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`_user_id` int(11) unsigned DEFAULT NULL,
`savedcalendar_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedcalendarsubscription`
--
LOCK TABLES `savedcalendarsubscription` WRITE;
/*!40000 ALTER TABLE `savedcalendarsubscription` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedcalendarsubscription` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedreport`
--
DROP TABLE IF EXISTS `savedreport`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedreport` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`moduleclassname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`type` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedreport`
--
LOCK TABLES `savedreport` WRITE;
/*!40000 ALTER TABLE `savedreport` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedreport` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedreport_read`
--
DROP TABLE IF EXISTS `savedreport_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedreport_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `savedreport_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedreport_read`
--
LOCK TABLES `savedreport_read` WRITE;
/*!40000 ALTER TABLE `savedreport_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedreport_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedreportstarred`
--
DROP TABLE IF EXISTS `savedreportstarred`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedreportstarred` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`basestarredmodel_id` int(11) unsigned DEFAULT NULL,
`savedreport_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `basestarredmodel_id_savedreport_id` (`basestarredmodel_id`,`savedreport_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedreportstarred`
--
LOCK TABLES `savedreportstarred` WRITE;
/*!40000 ALTER TABLE `savedreportstarred` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedreportstarred` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedsearch`
--
DROP TABLE IF EXISTS `savedsearch`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedsearch` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`viewclassname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedsearch`
--
LOCK TABLES `savedsearch` WRITE;
/*!40000 ALTER TABLE `savedsearch` DISABLE KEYS */;
/*!40000 ALTER TABLE `savedsearch` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `savedworkflow`
--
DROP TABLE IF EXISTS `savedworkflow`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `savedworkflow` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`isactive` tinyint(1) unsigned DEFAULT NULL,
`moduleclassname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`order` int(11) DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`type` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`triggeron` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `savedworkflow`
--
LOCK TABLES `savedworkflow` WRITE;
/*!40000 ALTER TABLE `savedworkflow` DISABLE KEYS */;
INSERT INTO `savedworkflow` VALUES (1,'This will create a task for the Contact owner to follow up with a contact if there has been no activity for 1 month',0,'ContactsModule','Contact follow up Task',1,'a:5:{s:17:\"triggersStructure\";s:1:\"1\";s:8:\"Triggers\";a:0:{}s:7:\"Actions\";a:1:{i:0;a:5:{s:4:\"type\";s:6:\"Create\";s:8:\"relation\";s:5:\"tasks\";s:14:\"relationFilter\";s:17:\"RelationFilterAll\";s:20:\"relatedModelRelation\";N;s:16:\"ActionAttributes\";a:4:{s:4:\"name\";a:3:{s:4:\"type\";s:6:\"Static\";s:5:\"value\";s:22:\"Follow up with contact\";s:14:\"shouldSetValue\";s:1:\"1\";}s:11:\"owner__User\";a:3:{s:4:\"type\";s:21:\"OwnerOfTriggeredModel\";s:5:\"value\";N;s:14:\"shouldSetValue\";s:1:\"1\";}s:6:\"status\";a:3:{s:4:\"type\";s:6:\"Static\";s:5:\"value\";i:1;s:14:\"shouldSetValue\";s:1:\"1\";}s:11:\"permissions\";a:3:{s:4:\"type\";s:20:\"SameAsTriggeredModel\";s:5:\"value\";N;s:14:\"shouldSetValue\";s:1:\"1\";}}}}s:13:\"EmailMessages\";a:0:{}s:11:\"TimeTrigger\";a:12:{s:16:\"durationInterval\";i:1;s:12:\"durationSign\";s:8:\"Positive\";s:12:\"durationType\";s:5:\"Month\";s:18:\"currencyIdForValue\";N;s:5:\"value\";N;s:11:\"secondValue\";N;s:26:\"thirdValueDurationInterval\";N;s:22:\"thirdValueDurationType\";N;s:9:\"valueType\";s:11:\"Is Time For\";s:14:\"relationFilter\";s:17:\"RelationFilterAny\";s:27:\"attributeIndexOrDerivedType\";s:22:\"latestActivityDateTime\";s:8:\"operator\";N;}}','ByTime','NewAndExisting',14),(2,'This will send an email to recipients that you choose when you close a deal!',0,'OpportunitiesModule','Closed won Opportunity alert',2,'a:4:{s:17:\"triggersStructure\";s:1:\"1\";s:8:\"Triggers\";a:1:{i:0;a:10:{s:18:\"currencyIdForValue\";N;s:5:\"value\";s:10:\"Closed Won\";s:11:\"secondValue\";N;s:26:\"thirdValueDurationInterval\";N;s:22:\"thirdValueDurationType\";N;s:24:\"stringifiedModelForValue\";N;s:9:\"valueType\";N;s:14:\"relationFilter\";s:17:\"RelationFilterAny\";s:27:\"attributeIndexOrDerivedType\";s:5:\"stage\";s:8:\"operator\";s:7:\"becomes\";}}s:7:\"Actions\";a:0:{}s:13:\"EmailMessages\";a:1:{i:0;a:8:{s:15:\"emailTemplateId\";i:7;s:25:\"sendAfterDurationInterval\";i:0;s:21:\"sendAfterDurationType\";s:6:\"Minute\";s:12:\"sendFromType\";s:7:\"Default\";s:12:\"sendFromName\";N;s:15:\"sendFromAddress\";N;s:24:\"excludeIfTriggeredByUser\";b:0;s:22:\"EmailMessageRecipients\";a:1:{i:0;a:4:{s:6:\"toName\";s:14:\"The Sales Team\";s:9:\"toAddress\";s:23:\"SalesTeam@mycompany.com\";s:4:\"type\";s:13:\"StaticAddress\";s:12:\"audienceType\";i:1;}}}}}','OnSave','NewAndExisting',16);
/*!40000 ALTER TABLE `savedworkflow` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `securableitem`
--
DROP TABLE IF EXISTS `securableitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `securableitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`item_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `item_id` (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `securableitem`
--
LOCK TABLES `securableitem` WRITE;
/*!40000 ALTER TABLE `securableitem` DISABLE KEYS */;
INSERT INTO `securableitem` VALUES (1,7),(2,9),(3,10),(4,11),(5,12),(6,13),(7,15);
/*!40000 ALTER TABLE `securableitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sellpriceformula`
--
DROP TABLE IF EXISTS `sellpriceformula`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sellpriceformula` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` int(11) DEFAULT NULL,
`discountormarkuppercentage` double DEFAULT NULL,
`producttemplate_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sellpriceformula`
--
LOCK TABLES `sellpriceformula` WRITE;
/*!40000 ALTER TABLE `sellpriceformula` DISABLE KEYS */;
/*!40000 ALTER TABLE `sellpriceformula` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sendgridemailaccount`
--
DROP TABLE IF EXISTS `sendgridemailaccount`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sendgridemailaccount` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`apiusername` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`apipassword` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`fromname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`fromaddress` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` text COLLATE utf8_unicode_ci,
`replytoaddress` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`item_id` int(11) unsigned DEFAULT NULL,
`_user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sendgridemailaccount`
--
LOCK TABLES `sendgridemailaccount` WRITE;
/*!40000 ALTER TABLE `sendgridemailaccount` DISABLE KEYS */;
/*!40000 ALTER TABLE `sendgridemailaccount` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `shorturl`
--
DROP TABLE IF EXISTS `shorturl`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shorturl` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`hash` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`url` text COLLATE utf8_unicode_ci,
`createddatetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `shorturl`
--
LOCK TABLES `shorturl` WRITE;
/*!40000 ALTER TABLE `shorturl` DISABLE KEYS */;
/*!40000 ALTER TABLE `shorturl` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `socialitem`
--
DROP TABLE IF EXISTS `socialitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `socialitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`latestdatetime` datetime DEFAULT NULL,
`ownedsecurableitem_id` int(11) unsigned DEFAULT NULL,
`note_id` int(11) unsigned DEFAULT NULL,
`touser__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `socialitem`
--
LOCK TABLES `socialitem` WRITE;
/*!40000 ALTER TABLE `socialitem` DISABLE KEYS */;
/*!40000 ALTER TABLE `socialitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `socialitem_read`
--
DROP TABLE IF EXISTS `socialitem_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `socialitem_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `socialitem_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `socialitem_read`
--
LOCK TABLES `socialitem_read` WRITE;
/*!40000 ALTER TABLE `socialitem_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `socialitem_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `stuckjob`
--
DROP TABLE IF EXISTS `stuckjob`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `stuckjob` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`quantity` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `stuckjob`
--
LOCK TABLES `stuckjob` WRITE;
/*!40000 ALTER TABLE `stuckjob` DISABLE KEYS */;
/*!40000 ALTER TABLE `stuckjob` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `task`
--
DROP TABLE IF EXISTS `task`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`completeddatetime` datetime DEFAULT NULL,
`completed` tinyint(1) unsigned DEFAULT NULL,
`duedatetime` datetime DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`activity_id` int(11) unsigned DEFAULT NULL,
`requestedbyuser__user_id` int(11) unsigned DEFAULT NULL,
`project_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `task`
--
LOCK TABLES `task` WRITE;
/*!40000 ALTER TABLE `task` DISABLE KEYS */;
/*!40000 ALTER TABLE `task` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `task_read`
--
DROP TABLE IF EXISTS `task_read`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task_read` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`securableitem_id` int(11) unsigned NOT NULL,
`munge_id` varchar(12) COLLATE utf8_unicode_ci NOT NULL,
`count` int(8) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `securableitem_id_munge_id` (`securableitem_id`,`munge_id`),
KEY `task_read_securableitem_id` (`securableitem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `task_read`
--
LOCK TABLES `task_read` WRITE;
/*!40000 ALTER TABLE `task_read` DISABLE KEYS */;
/*!40000 ALTER TABLE `task_read` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `task_read_subscription`
--
DROP TABLE IF EXISTS `task_read_subscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task_read_subscription` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userid` int(11) unsigned NOT NULL,
`modelid` int(11) unsigned NOT NULL,
`modifieddatetime` datetime DEFAULT NULL,
`subscriptiontype` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userid_modelid` (`userid`,`modelid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `task_read_subscription`
--
LOCK TABLES `task_read_subscription` WRITE;
/*!40000 ALTER TABLE `task_read_subscription` DISABLE KEYS */;
/*!40000 ALTER TABLE `task_read_subscription` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `taskchecklistitem`
--
DROP TABLE IF EXISTS `taskchecklistitem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `taskchecklistitem` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` text COLLATE utf8_unicode_ci,
`sortorder` int(11) DEFAULT NULL,
`completed` tinyint(1) unsigned DEFAULT NULL,
`task_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `taskchecklistitem`
--
LOCK TABLES `taskchecklistitem` WRITE;
/*!40000 ALTER TABLE `taskchecklistitem` DISABLE KEYS */;
/*!40000 ALTER TABLE `taskchecklistitem` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `workflowmessageinqueue`
--
DROP TABLE IF EXISTS `workflowmessageinqueue`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `workflowmessageinqueue` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`modelclassname` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
`processdatetime` datetime DEFAULT NULL,
`serializeddata` text COLLATE utf8_unicode_ci,
`item_id` int(11) unsigned DEFAULT NULL,
`modelitem_item_id` int(11) unsigned DEFAULT NULL,
`savedworkflow_id` int(11) unsigned DEFAULT NULL,
`triggeredbyuser__user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `workflowmessageinqueue`
--
LOCK TABLES `workflowmessageinqueue` WRITE;
/*!40000 ALTER TABLE `workflowmessageinqueue` DISABLE KEYS */;
/*!40000 ALTER TABLE `workflowmessageinqueue` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping routines for database 'zurmo327'
--
/*!50003 DROP FUNCTION IF EXISTS `any_user_in_a_sub_role_has_read_permission` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `any_user_in_a_sub_role_has_read_permission`(
securableitem_id int(11),
role_id int(11),
class_name varchar(255),
module_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare has_read tinyint default 0;
call any_user_in_a_sub_role_has_read_permission(securableitem_id, role_id, class_name, module_name, has_read);
return has_read;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `create_email_message` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `create_email_message`(text_content text, html_content text, from_name varchar(128),
from_address varchar(255), user_id int, owner_id int,
subject varchar(255), headers text, folder_id int,
serialized_data text, to_address varchar(255), to_name varchar(128),
recipient_type int, contact_item_id int,
related_model_type varchar(255), related_model_id int,
now_timestamp datetime, content_type varchar(255),
campaign_content_id int, contact_id int, autoresponder_content_id int) RETURNS int(11)
MODIFIES SQL DATA
begin
insert into `emailmessagecontent` ( `textcontent`, `htmlcontent` )
values ( text_content, html_content );
set @contentId = last_insert_id();
insert into `emailmessagesender` ( `fromname`, `fromaddress` )
values ( from_name, from_address );
set @senderId = last_insert_id();
set @emailMessageItemId = create_item(1, now_timestamp);
insert into `securableitem` ( `item_id` )
values ( @emailMessageItemId );
insert into `ownedsecurableitem` ( `securableitem_id`, `owner__user_id` )
values ( last_insert_id(), owner_id );
insert into `emailmessage` ( `subject`, `headers`, `ownedsecurableitem_id`,
`content_emailmessagecontent_id`, `sender_emailmessagesender_id`,
`folder_emailfolder_id`, `contenttype`,
`campaigncontent_campaignemailmessagecontent_id`, `contact_contact_id`, `autorespondercontent_autoresponderemailmessagecontent_id`)
values ( subject, headers, last_insert_id(), @contentId, @senderId, folder_id, content_type, campaign_content_id, contact_id, autoresponder_content_id);
set @emailMessageId = LAST_INSERT_ID();
insert into `auditevent` ( `datetime`, `modulename`, `eventname`, `_user_id`,
`modelclassname`, `modelid`, `serializeddata` )
values ( now_timestamp, "ZurmoModule", "Item Created", user_id,
"EmailMessage", @emailMessageId, serialized_data );
insert into `emailmessagerecipient` ( `toaddress`, `toname`, `type`, `emailmessage_id` )
values ( to_address, to_name, recipient_type, @emailMessageId );
set @recipientId = last_insert_id();
insert into `emailmessagerecipient_item` ( `emailmessagerecipient_id`, `item_id` )
values ( @recipientId, contact_item_id );
call duplicate_filemodels(related_model_type, related_model_id, "emailmessage", @emailMessageId, user_id, now_timestamp);
return @emailMessageId;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `create_item` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `create_item`(user_id int, now_timestamp datetime) RETURNS int(11)
begin
insert into `item` ( `id`, `createddatetime`, `modifieddatetime`,
`createdbyuser__user_id`, `modifiedbyuser__user_id` )
VALUES ( NULL, now_timestamp , now_timestamp, user_id, user_id );
return last_insert_id();
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_group_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_group_actual_right`(
_group_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
select get_group_explicit_actual_right (_group_id, module_name, right_name) |
get_group_inherited_actual_right(_group_id, module_name, right_name)
into result;
if (result & 2) = 2 then
return 2;
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_group_explicit_actual_policy` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_group_explicit_actual_policy`(
_group_id int(11),
module_name varchar(255),
policy_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _group
where id = _group_id;
select get_permitable_explicit_actual_policy(_permitable_id, module_name, policy_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_group_explicit_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_group_explicit_actual_right`(
_group_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _group
where id = _group_id;
select get_permitable_explicit_actual_right(_permitable_id, module_name, right_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_group_inherited_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_group_inherited_actual_right`(
_group_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare combined_right tinyint;
call get_group_inherited_actual_right_ignoring_everyone(_group_id, module_name, right_name, combined_right);
select combined_right |
get_named_group_explicit_actual_right('Everyone', module_name, right_name)
into combined_right;
if (combined_right & 2) = 2 then
return 2;
end if;
return combined_right;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_named_group_explicit_actual_policy` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_named_group_explicit_actual_policy`(
group_name varchar(255),
module_name varchar(255),
policy_name varchar(255)
) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci
READS SQL DATA
DETERMINISTIC
begin # but since PDO returns it as a string I am too, until I know if that is a bad thing.
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _group
where name = group_name;
select get_permitable_explicit_actual_policy(_permitable_id, module_name, policy_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_named_group_explicit_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_named_group_explicit_actual_right`(
group_name varchar(255),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _group
where name = group_name;
select get_permitable_explicit_actual_right(_permitable_id, module_name, right_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_permitable_explicit_actual_policy` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_permitable_explicit_actual_policy`(
permitable_id int(11),
module_name varchar(255),
policy_name varchar(255)
) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci
READS SQL DATA
DETERMINISTIC
begin # but since PDO returns it as a string I am too, until I know if that is a bad thing.
declare result tinyint;
select value
into result
from policy
where policy.modulename = module_name and
name = policy_name and
policy.permitable_id = permitable_id
limit 1;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_permitable_explicit_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_permitable_explicit_actual_right`(
permitable_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
select max(type)
into result
from _right
where _right.modulename = module_name and
name = right_name and
_right.permitable_id = permitable_id;
if result is null then
return 0;
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_permitable_group_id` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_permitable_group_id`(
_permitable_id int(11)
) RETURNS int(11)
begin
declare result int(11);
select id
into result
from _group
where _group.permitable_id = _permitable_id;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_permitable_user_id` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_permitable_user_id`(
_permitable_id int(11)
) RETURNS int(11)
READS SQL DATA
DETERMINISTIC
begin
declare result int(11);
select id
into result
from _user
where _user.permitable_id = _permitable_id;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_securableitem_actual_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_securableitem_actual_permissions_for_permitable`(
_securableitem_id int(11),
_permitable_id int(11),
class_name varchar(255),
module_name varchar(255),
caching_on tinyint
) RETURNS smallint(6)
READS SQL DATA
DETERMINISTIC
begin
declare allow_permissions, deny_permissions smallint default 0;
declare is_super_administrator, is_owner tinyint;
delete from __role_children_cache;
select named_group_contains_permitable('Super Administrators', _permitable_id)
into is_super_administrator;
if is_super_administrator then
set allow_permissions = 31;
set deny_permissions = 0;
else # Not Coding Standard
begin
select _securableitem_id in
(select securableitem_id
from _user, ownedsecurableitem
where _user.id = ownedsecurableitem.owner__user_id and
permitable_id = _permitable_id)
into is_owner;
end;
if is_owner then
set allow_permissions = 31;
set deny_permissions = 0;
else # Not Coding Standard
if caching_on then
call get_securableitem_cached_actual_permissions_for_permitable(_securableitem_id, _permitable_id, allow_permissions, deny_permissions);
if allow_permissions is null then
call recursive_get_securableitem_actual_permissions_for_permitable(_securableitem_id, _permitable_id, class_name, module_name, allow_permissions, deny_permissions);
call cache_securableitem_actual_permissions_for_permitable(_securableitem_id, _permitable_id, allow_permissions, deny_permissions);
end if;
else # Not Coding Standard
call recursive_get_securableitem_actual_permissions_for_permitable(_securableitem_id, _permitable_id, class_name, module_name, allow_permissions, deny_permissions);
end if;
end if;
end if;
return (allow_permissions << 8) | deny_permissions;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_user_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_user_actual_right`(
_user_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare is_super_administrator tinyint;
select named_group_contains_user('Super Administrators', _user_id)
into is_super_administrator;
if is_super_administrator then
set result = 1;
else # Not Coding Standard
call recursive_get_user_actual_right(_user_id, module_name, right_name, result);
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_user_explicit_actual_policy` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_user_explicit_actual_policy`(
_user_id int(11),
module_name varchar(255),
policy_name varchar(255)
) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci
READS SQL DATA
DETERMINISTIC
begin # but since PDO returns it as a string I am too, until I know if that is a bad thing.
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _user
where id = _user_id;
select get_permitable_explicit_actual_policy(_permitable_id, module_name, policy_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_user_explicit_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_user_explicit_actual_right`(
_user_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare _permitable_id int;
select permitable_id
into _permitable_id
from _user
where id = _user_id;
select get_permitable_explicit_actual_right(_permitable_id, module_name, right_name)
into result;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_user_inherited_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `get_user_inherited_actual_right`(
_user_id int(11),
module_name varchar(255),
right_name varchar(255)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare combined_right tinyint default 0;
declare __group_id int(11);
declare no_more_records tinyint default 0;
declare _group_ids cursor for
select _group_id
from _group__user
where _group__user._user_id = _user_id;
declare continue handler for not found
set no_more_records = 1;
open _group_ids;
fetch _group_ids into __group_id;
while no_more_records = 0 do
select combined_right |
get_group_explicit_actual_right (__group_id, module_name, right_name) |
get_group_inherited_actual_right(__group_id, module_name, right_name)
into combined_right;
fetch _group_ids into __group_id;
end while;
close _group_ids;
select combined_right |
get_named_group_explicit_actual_right('Everyone', module_name, right_name)
into combined_right;
if (combined_right & 2) = 2 then
return 2;
end if;
return combined_right;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `group_contains_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `group_contains_permitable`(
_group_id int(11),
_permitable_id int(11)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint default 0;
declare _group_name varchar(255);
declare is_everyone tinyint;
declare _user_id int(11);
declare group_id_2 int(11);
select name
into _group_name
from _group
where _group.id = _group_id;
if _group_name = 'Everyone' then
set result = 1;
else # Not Coding Standard
set _user_id = get_permitable_user_id(_permitable_id);
if _user_id is not null then
call recursive_group_contains_user(_group_id, _user_id, result);
else # Not Coding Standard
set group_id_2 = get_permitable_group_id(_permitable_id);
if group_id_2 is not null then
call recursive_group_contains_group(_group_id, group_id_2, result);
end if;
end if;
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `group_contains_user` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `group_contains_user`(
_group_id int(11),
_user_id int(11)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint default 0;
call recursive_group_contains_user(_group_id, _user_id, result);
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `named_group_contains_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `named_group_contains_permitable`(
group_name varchar(255),
_permitable_id int(11)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint default 0;
declare group_id_1 int(11);
declare _user_id int(11);
declare group_id_2 int(11);
if group_name = 'Everyone' then
set result = 1;
else # Not Coding Standard
select id
into group_id_1
from _group
where _group.name = group_name;
set _user_id = get_permitable_user_id(_permitable_id);
if _user_id is not null then
call recursive_group_contains_user(group_id_1, _user_id, result);
else # Not Coding Standard
set group_id_2 = get_permitable_group_id(_permitable_id);
if group_id_2 is not null then
call recursive_group_contains_group(group_id_1, group_id_2, result);
end if;
end if;
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `named_group_contains_user` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `named_group_contains_user`(
_group_name varchar(255),
_user_id int(11)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint default 0;
declare _group_id int(11);
if _group_name = 'Everyone' then
set result = 1;
else # Not Coding Standard
select id
into _group_id
from _group
where _group.name = _group_name;
call recursive_group_contains_user(_group_id, _user_id, result);
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `permitable_contains_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE FUNCTION `permitable_contains_permitable`(
permitable_id_1 int(11),
permitable_id_2 int(11)
) RETURNS tinyint(4)
READS SQL DATA
DETERMINISTIC
begin
declare result tinyint;
declare user_id_1, user_id_2, group_id_1, group_id_2 int(11);
# If they are both users just compare if they are the same user.
select get_permitable_user_id(permitable_id_1)
into user_id_1;
select get_permitable_user_id(permitable_id_2)
into user_id_2;
if user_id_1 is not null and user_id_2 is not null then
set result = permitable_id_1 = permitable_id_2;
else # Not Coding Standard
# If the first is a user and the second is a group return false.
select get_permitable_group_id(permitable_id_2)
into group_id_2;
if user_id_1 is not null and group_id_2 is not null then
set result = 0;
else # Not Coding Standard
# Otherwise the first is a group, just return if it contains
# the second.
select get_permitable_group_id(permitable_id_1)
into group_id_1;
if group_id_1 is not null then
select group_contains_permitable(group_id_1, permitable_id_2)
into result;
end if;
end if;
end if;
return result;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `cache_securableitem_actual_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `cache_securableitem_actual_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
in _allow_permissions tinyint,
in _deny_permissions tinyint
)
begin
# Tables cannot be created inside stored routines
# so this cannot automatically create the cache
# table if it doesn't exist. So it is done when
# the stored routines are created.
insert into actual_permissions_cache
values (_securableitem_id, _permitable_id, _allow_permissions, _deny_permissions);
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `clear_cache_actual_rights` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `clear_cache_actual_rights`()
READS SQL DATA
begin
delete from actual_rights_cache;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `clear_cache_all_actual_permissions` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `clear_cache_all_actual_permissions`()
READS SQL DATA
begin
delete from actual_permissions_cache;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `clear_cache_named_securable_all_actual_permissions` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `clear_cache_named_securable_all_actual_permissions`()
READS SQL DATA
begin
delete from named_securable_actual_permissions_cache;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `clear_cache_securableitem_actual_permissions` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `clear_cache_securableitem_actual_permissions`(
in _securableitem_id int(11)
)
begin
delete from actual_permissions_cache
where securableitem_id = _securableitem_id;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `create_campaign_items` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `create_campaign_items`(campaign_id int, marketing_list_id int, processed int)
begin
insert into `campaignitem` (`id`, `processed`, `campaign_id`, `contact_id`)
select null as id, processed as `processed`, campaign_id as `campaign_id`, `marketinglistmember`.`contact_id`
from `marketinglistmember`
left join `campaignitem` on `campaignitem`.`contact_id` = `marketinglistmember`.`contact_id`
and `campaignitem`.`campaign_id` = campaign_id
left join `contact` on `contact`.`id` = `marketinglistmember`.`contact_id`
where (`marketinglistmember`.`marketinglist_id` = marketing_list_id
and `campaignitem`.`id` is null and `contact`.`id` is not null);
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `decrement_count` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `decrement_count`(
in munge_table_name varchar(255),
in _securableitem_id int(11),
in item_id int(11),
in _type char
)
begin
update munge_table_name
set count = count - 1
where securableitem_id = _securableitem_id and
munge_id = concat(_type, item_id);
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `decrement_parent_roles_counts` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `decrement_parent_roles_counts`(
in munge_table_name varchar(255),
in securableitem_id int(11),
in role_id int(11)
)
begin
declare parent_role_id int(11);
select role_id
into parent_role_id
from role
where id = role_id;
if parent_role_id is not null then
call decrement_count (munge_table_name, securableitem_id, parent_role_id);
call decrement_parent_roles_counts(munge_table_name, securableitem_id, parent_role_id);
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `duplicate_filemodels` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `duplicate_filemodels`(related_model_type varchar(255), related_model_id int,
new_model_type varchar(255), new_model_id int, user_id int,
now_timestamp datetime)
begin
insert into `filemodel` (`id`, `name`, `size`, `type`, `item_id`,
`filecontent_id`, `relatedmodel_id`, `relatedmodel_type`)
select null as `id`, `name`, `size`, `type`, (select create_item(user_id, now_timestamp)) as `item_id`, `filecontent_id`,
new_model_id as `relatedmodel_id`, new_model_type as `relatedmodel_type`
from `filemodel`
where `relatedmodel_type` = related_model_type and `relatedmodel_id` = related_model_id;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `generate_campaign_items` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `generate_campaign_items`(active_status int, processing_status int, now_timestamp datetime)
begin
declare loop0_eof boolean default false;
declare campaign_id int(11);
declare marketinglist_id int(11);
declare cursor0 cursor for select `campaign`.`id`, `campaign`.`marketinglist_id` from `campaign`
where ((`campaign`.`status` = active_status) and (`campaign`.`sendondatetime` < now_timestamp));
declare continue handler for not found set loop0_eof = TRUE;
open cursor0;
loop0: loop
fetch cursor0 into campaign_id, marketinglist_id;
if loop0_eof then
leave loop0;
end if;
call create_campaign_items(campaign_id, marketinglist_id, 0);
update `campaign` set `status` = processing_status where id = campaign_id;
end loop loop0;
close cursor0;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_group_inherited_actual_right_ignoring_everyone` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_group_inherited_actual_right_ignoring_everyone`(
in _group_id int(11),
in module_name varchar(255),
in right_name varchar(255),
out result tinyint
)
begin
declare parent_group_id int(11);
set result = 0;
select _group._group_id
into parent_group_id
from _group
where id = _group_id;
if parent_group_id is not null then
call get_group_inherited_actual_right_ignoring_everyone(parent_group_id, module_name, right_name, result);
select result |
get_group_explicit_actual_right(parent_group_id, module_name, right_name)
into result;
if (result & 2) = 2 then
set result = 2;
end if;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_securableitem_cached_actual_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_securableitem_cached_actual_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
out _allow_permissions tinyint,
out _deny_permissions tinyint
)
begin
select allow_permissions, deny_permissions
into _allow_permissions, _deny_permissions
from actual_permissions_cache
where securableitem_id = _securableitem_id and
permitable_id = _permitable_id;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_securableitem_explicit_actual_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_securableitem_explicit_actual_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
out allow_permissions tinyint,
out deny_permissions tinyint
)
begin
select bit_or(permissions)
into allow_permissions
from permission
where type = 1 and
permitable_id = _permitable_id and
securableitem_id = _securableitem_id;
select bit_or(permissions)
into deny_permissions
from permission
where type = 2 and
permitable_id = _permitable_id and
securableitem_id = _securableitem_id;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_securableitem_explicit_inherited_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_securableitem_explicit_inherited_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
out allow_permissions tinyint,
out deny_permissions tinyint
)
begin
declare permissions_permitable_id int(11);
declare _type, _permissions, permission_applies tinyint;
declare no_more_records tinyint default 0;
declare permitable_id_type_and_permissions cursor for
select permitable_id, type, bit_or(permissions)
from permission
where securableitem_id = _securableitem_id
group by permitable_id, type;
declare continue handler for not found
set no_more_records = 1;
set allow_permissions = 0;
set deny_permissions = 0;
open permitable_id_type_and_permissions;
fetch permitable_id_type_and_permissions into
permissions_permitable_id, _type, _permissions;
# The query will return at most one row with the allow bits and
# one with the deny bits, so this loop will loop 0, 1, or 2 times.
while no_more_records = 0 do
select permitable_contains_permitable(permissions_permitable_id, _permitable_id)
into permission_applies;
if permission_applies then
if _type = 1 then
set allow_permissions = allow_permissions | _permissions;
else # Not Coding Standard
set deny_permissions = deny_permissions | _permissions;
end if;
end if;
fetch permitable_id_type_and_permissions into
permissions_permitable_id, _type, _permissions;
end while;
close permitable_id_type_and_permissions;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_securableitem_module_and_model_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_securableitem_module_and_model_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
in class_name varchar(255),
in module_name varchar(255),
out allow_permissions tinyint,
out deny_permissions tinyint
)
begin
declare permissions_permitable_id int(11);
declare _type, _permissions, permission_applies tinyint;
declare no_more_records tinyint default 0;
declare permitable_id_type_and_permissions_for_namedsecurableitem cursor for
select permitable_id, type, bit_or(permissions)
from permission, namedsecurableitem
where permission.securableitem_id = namedsecurableitem.securableitem_id and
(name = class_name or name = module_name)
group by permitable_id, type;
declare continue handler for not found
set no_more_records = 1;
set allow_permissions = 0;
set deny_permissions = 0;
open permitable_id_type_and_permissions_for_namedsecurableitem;
fetch permitable_id_type_and_permissions_for_namedsecurableitem into
permissions_permitable_id, _type, _permissions;
# The query will return at most one row with the allow bits and
# one with the deny bits, so this loop will loop 0, 1, or 2 times.
while no_more_records = 0 do
select permitable_contains_permitable(permissions_permitable_id, _permitable_id)
into permission_applies;
if permission_applies then
if _type = 1 then
set allow_permissions = allow_permissions | _permissions;
else # Not Coding Standard
set deny_permissions = deny_permissions | _permissions;
end if;
end if;
fetch permitable_id_type_and_permissions_for_namedsecurableitem into
permissions_permitable_id, _type, _permissions;
end while;
close permitable_id_type_and_permissions_for_namedsecurableitem;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `get_securableitem_propagated_allow_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `get_securableitem_propagated_allow_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
in class_name varchar(255),
in module_name varchar(255),
out allow_permissions tinyint
)
begin
declare user_id int(11);
declare user_role_id int(11);
declare parent_role_id int(11);
select role_id into user_role_id from _user where permitable_id = _permitable_id;
set allow_permissions = 0;
select get_permitable_user_id(_permitable_id)
into user_id;
if user_id is not null then
call recursive_get_all_descendent_roles(_permitable_id, user_role_id);
call recursive_get_securableitem_propagated_allow_permissions_permit(_securableitem_id, _permitable_id, class_name, module_name, allow_permissions);
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `increment_count` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `increment_count`(
in munge_table_name varchar(255),
in securableitem_id int(11),
in item_id int(11),
in _type char
)
begin
# TODO: insert only if the row doesn't exist
# in a way that doesn't ignore all errors.
set @sql = concat("insert into ", munge_table_name,
"(securableitem_id, munge_id, count) ",
"values (", securableitem_id, ", '", concat(_type, item_id), "', 1) ",
"on duplicate key ",
"update count = count + 1");
prepare statement from @sql;
execute statement;
deallocate prepare statement;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `increment_parent_roles_counts` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `increment_parent_roles_counts`(
in munge_table_name varchar(255),
in securableitem_id int(11),
in _role_id int(11)
)
begin
declare parent_role_id int(11);
select role_id
into parent_role_id
from role
where id = _role_id;
if parent_role_id is not null then
call increment_count (munge_table_name, securableitem_id, parent_role_id, "R");
call increment_parent_roles_counts(munge_table_name, securableitem_id, parent_role_id);
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
call recreate_tables(munge_table_name);
call rebuild_users (model_table_name, munge_table_name);
call rebuild_groups (model_table_name, munge_table_name);
call rebuild_roles (model_table_name, munge_table_name);
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_a_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_a_permitable`(
in munge_table_name varchar(255),
in securableitem_id int(11),
in actual_id int(11),
in _permitable_id int(11),
in _type char
)
begin
declare allow_permissions, deny_permissions, effective_explicit_permissions smallint default 0;
call get_securableitem_explicit_actual_permissions_for_permitable(securableitem_id, _permitable_id, allow_permissions, deny_permissions);
set effective_explicit_permissions = allow_permissions & ~deny_permissions;
if (effective_explicit_permissions & 1) = 1 then # Permission::READ
call increment_count(munge_table_name, securableitem_id, actual_id, _type);
if _type = "G" then
call rebuild_roles_for_users_in_group(munge_table_name, securableitem_id, actual_id);
call rebuild_sub_groups (munge_table_name, securableitem_id, actual_id);
end if;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_groups` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_groups`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
set @select_statement = concat("select permission.securableitem_id, _group.id, permission.permitable_id
from ", model_table_name , ", ownedsecurableitem, permission, _group
where
", model_table_name, ".ownedsecurableitem_id = ownedsecurableitem.id AND
ownedsecurableitem.securableitem_id = permission.securableitem_id AND
permission.permitable_id = _group.permitable_id");
set @rebuild_groups_temp_table = CONCAT("create temporary table rebuild_temp_table as ", @select_statement);
prepare statement FROM @rebuild_groups_temp_table;
execute statement;
deallocate prepare statement;
begin
declare _securableitem_id, __group_id, _permitable_id int(11);
declare no_more_records tinyint default 0;
declare securableitem_group_and_permitable_ids cursor for
select * from rebuild_temp_table;
declare continue handler for not found
set no_more_records = 1;
open securableitem_group_and_permitable_ids;
fetch securableitem_group_and_permitable_ids into _securableitem_id, __group_id, _permitable_id;
while no_more_records = 0 do
call rebuild_a_permitable(munge_table_name, _securableitem_id, __group_id, _permitable_id, "G");
fetch securableitem_group_and_permitable_ids into _securableitem_id, __group_id, _permitable_id;
end while;
close securableitem_group_and_permitable_ids;
drop temporary table if exists rebuild_temp_table;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_roles` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_roles`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
call rebuild_roles_owned_securableitems (model_table_name, munge_table_name);
call rebuild_roles_securableitem_with_explicit_user_permissions (model_table_name, munge_table_name);
call rebuild_roles_securableitem_with_explicit_group_permissions(model_table_name, munge_table_name);
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_roles_for_users_in_group` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_roles_for_users_in_group`(
in munge_table_name varchar(255),
in _securableitem_id int(11),
in __group_id int(11)
)
begin
declare _role_id int(11);
declare no_more_records tinyint default 0;
declare role_ids cursor for
select role_id
from _group__user, _user
where _group__user._group_id = __group_id and
_user.id = _group__user._user_id;
declare continue handler for not found
set no_more_records = 1;
open role_ids;
fetch role_ids into _role_id;
while no_more_records = 0 do
call increment_parent_roles_counts(munge_table_name, _securableitem_id, _role_id);
fetch role_ids into _role_id;
end while;
close role_ids;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_roles_owned_securableitems` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_roles_owned_securableitems`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
set @select_statement = concat("select role_id, ownedsecurableitem.securableitem_id
from ", model_table_name, ", _user, ownedsecurableitem
where ", model_table_name, ".ownedsecurableitem_id = ownedsecurableitem.id AND
_user.id = ownedsecurableitem.owner__user_id and _user.role_id is not null");
set @rebuild_roles_temp_table = CONCAT("create temporary table rebuild_temp_table as ", @select_statement);
prepare statement FROM @rebuild_roles_temp_table;
execute statement;
deallocate prepare statement;
begin
declare _role_id, _securableitem_id int(11);
declare no_more_records tinyint default 0;
declare role_and_securableitem_ids cursor for
select * from rebuild_temp_table;
declare continue handler for not found
set no_more_records = 1;
open role_and_securableitem_ids;
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
while no_more_records = 0 do
call increment_parent_roles_counts(munge_table_name, _securableitem_id, _role_id);
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
end while;
close role_and_securableitem_ids;
drop temporary table if exists rebuild_temp_table;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_roles_securableitem_with_explicit_group_permissions` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_roles_securableitem_with_explicit_group_permissions`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
set @select_statement = concat("select role.role_id, permission.securableitem_id
from ", model_table_name, ", ownedsecurableitem, _user, _group, _group__user, permission, role
where ", model_table_name, ".ownedsecurableitem_id = ownedsecurableitem.id and
ownedsecurableitem.securableitem_id = permission.securableitem_id and
_user.id = _group__user._user_id and
permission.permitable_id = _group.permitable_id and
_group__user._group_id = _group.id and
_user.role_id = role.role_id and
((permission.permissions & 1) = 1) and
permission.type = 1");
set @rebuild_roles_temp_table = CONCAT("create temporary table rebuild_temp_table as ", @select_statement);
prepare statement FROM @rebuild_roles_temp_table;
execute statement;
deallocate prepare statement;
begin
declare _role_id, _securableitem_id int(11);
declare no_more_records tinyint default 0;
declare role_and_securableitem_ids cursor for
select * from rebuild_temp_table;
declare continue handler for not found
set no_more_records = 1;
open role_and_securableitem_ids;
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
while no_more_records = 0 do
call increment_count (munge_table_name, _securableitem_id, _role_id, "R");
call increment_parent_roles_counts(munge_table_name, _securableitem_id, _role_id);
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
end while;
close role_and_securableitem_ids;
drop temporary table if exists rebuild_temp_table;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_roles_securableitem_with_explicit_user_permissions` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_roles_securableitem_with_explicit_user_permissions`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
set @select_statement = concat("select role_id, permission.securableitem_id
from ", model_table_name, ", ownedsecurableitem, permission, _user
where ", model_table_name, ".ownedsecurableitem_id = ownedsecurableitem.id AND
ownedsecurableitem.securableitem_id = permission.securableitem_id AND
permission.permitable_id = _user.permitable_id and
((permission.permissions & 1) = 1) and permission.type = 1");
set @rebuild_roles_temp_table = CONCAT("create temporary table rebuild_temp_table as ", @select_statement);
prepare statement FROM @rebuild_roles_temp_table;
execute statement;
deallocate prepare statement;
begin
declare _role_id, _securableitem_id int(11);
declare no_more_records tinyint default 0;
declare role_and_securableitem_ids cursor for
select * from rebuild_temp_table;
declare continue handler for not found
set no_more_records = 1;
open role_and_securableitem_ids;
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
while no_more_records = 0 do
call increment_parent_roles_counts(munge_table_name, _securableitem_id, _role_id);
fetch role_and_securableitem_ids into _role_id, _securableitem_id;
end while;
close role_and_securableitem_ids;
drop temporary table if exists rebuild_temp_table;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_sub_groups` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_sub_groups`(
in munge_table_name varchar(255),
in _securableitem_id int(11),
in __group_id int(11)
)
begin
declare sub_group_id int(11);
declare no_more_records tinyint default 0;
declare sub_group_ids cursor for
select id
from _group
where _group_id = __group_id;
declare continue handler for not found
set no_more_records = 1;
open sub_group_ids;
fetch sub_group_ids into sub_group_id;
while no_more_records = 0 do
call increment_count (munge_table_name, _securableitem_id, sub_group_id, "G");
call rebuild_roles_for_users_in_group(munge_table_name, _securableitem_id, sub_group_id);
call rebuild_sub_groups (munge_table_name, _securableitem_id, sub_group_id);
fetch sub_group_ids into sub_group_id;
end while;
close sub_group_ids;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `rebuild_users` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `rebuild_users`(
in model_table_name varchar(255),
in munge_table_name varchar(255)
)
begin
set @select_statement = concat("select permission.securableitem_id, _user.id, permission.permitable_id
from ", model_table_name, ", ownedsecurableitem, permission, _user
where ", model_table_name , ".ownedsecurableitem_id = ownedsecurableitem.id and
ownedsecurableitem.securableitem_id = permission.securableitem_id and
permission.permitable_id = _user.permitable_id");
set @rebuild_users_temp_table = CONCAT("create temporary table rebuild_temp_table as ", @select_statement);
prepare statement FROM @rebuild_users_temp_table;
execute statement;
deallocate prepare statement;
begin
declare _securableitem_id, __user_id, _permitable_id int(11);
declare no_more_records tinyint default 0;
declare securableitem_user_and_permitable_ids cursor for
select * from rebuild_temp_table;
declare continue handler for not found
set no_more_records = 1;
open securableitem_user_and_permitable_ids;
fetch securableitem_user_and_permitable_ids into _securableitem_id, __user_id, _permitable_id;
while no_more_records = 0 do
call rebuild_a_permitable(munge_table_name, _securableitem_id, __user_id, _permitable_id, "U");
fetch securableitem_user_and_permitable_ids into _securableitem_id, __user_id, _permitable_id;
end while;
close securableitem_user_and_permitable_ids;
drop temporary table if exists rebuild_temp_table;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recreate_tables` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recreate_tables`(
in munge_table_name varchar(255)
)
begin
set @sql = concat("drop table if exists ", munge_table_name);
prepare statement from @sql;
execute statement;
deallocate prepare statement;
set @sql = concat("create table ", munge_table_name, " (",
"securableitem_id int(11) unsigned not null, ",
"munge_id varchar(12) null, ",
"count int(8) unsigned not null, ",
"primary key (securableitem_id, munge_id))");
prepare statement from @sql;
execute statement;
deallocate prepare statement;
set @sql = concat("create index index_", munge_table_name, "_securableitem_id", " ",
"on ", munge_table_name, " (securableitem_id)");
prepare statement from @sql;
execute statement;
deallocate prepare statement;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_get_all_descendent_roles` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_get_all_descendent_roles`(in _permitable_id int(11), in parent_role_id int(11))
begin
declare child_role_id int(11);
declare no_more_records tinyint default 0;
declare child_role_ids cursor for
select id
from role
where role_id = parent_role_id;
declare continue handler for not found
set no_more_records = 1;
open child_role_ids;
fetch child_role_ids into child_role_id;
while no_more_records = 0 do
INSERT IGNORE INTO __role_children_cache VALUES (_permitable_id, child_role_id);
call recursive_get_all_descendent_roles(_permitable_id, child_role_id);
fetch child_role_ids into child_role_id;
end while;
close child_role_ids;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_get_securableitem_actual_permissions_for_permitable` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_get_securableitem_actual_permissions_for_permitable`(
in _securableitem_id int(11),
in _permitable_id int(11),
in class_name varchar(255),
in module_name varchar(255),
out allow_permissions tinyint,
out deny_permissions tinyint
)
begin
declare propagated_allow_permissions tinyint default 0;
declare nameditem_allow_permissions, nameditem_deny_permissions tinyint default 0;
declare is_owner tinyint;
begin
select _securableitem_id in
(select securableitem_id
from _user, ownedsecurableitem
where _user.id = ownedsecurableitem.owner__user_id and
permitable_id = _permitable_id)
into is_owner;
end;
if is_owner then
set allow_permissions = 31;
set deny_permissions = 0;
else # Not Coding Standard
set allow_permissions = 0;
set deny_permissions = 0;
call get_securableitem_explicit_inherited_permissions_for_permitable(_securableitem_id, _permitable_id, allow_permissions, deny_permissions);
call get_securableitem_propagated_allow_permissions_for_permitable (_securableitem_id, _permitable_id, class_name, module_name, propagated_allow_permissions);
call get_securableitem_module_and_model_permissions_for_permitable (_securableitem_id, _permitable_id, class_name, module_name, nameditem_allow_permissions, nameditem_deny_permissions);
set allow_permissions = allow_permissions | propagated_allow_permissions | nameditem_allow_permissions;
set deny_permissions = deny_permissions | nameditem_deny_permissions;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_get_securableitem_propagated_allow_permissions_permit` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_get_securableitem_propagated_allow_permissions_permit`(
in _securableitem_id int(11),
in _permitable_id int(11),
in class_name varchar(255),
in module_name varchar(255),
out allow_permissions tinyint
)
begin
declare user_allow_permissions, user_deny_permissions, user_propagated_allow_permissions tinyint;
set allow_permissions = 0;
begin
declare sub_role_id int(11);
declare no_more_records tinyint default 0;
declare sub_role_ids cursor for
select role_id
from __role_children_cache
where permitable_id = _permitable_id;
declare continue handler for not found
begin
set no_more_records = 1;
end;
open sub_role_ids;
fetch sub_role_ids into sub_role_id;
while no_more_records = 0 do
begin
declare propagated_allow_permissions tinyint;
declare user_in_role_id, permitable_in_role_id int(11);
declare permitable_in_role_ids cursor for
select permitable_id
from _user
where role_id = sub_role_id;
open permitable_in_role_ids;
fetch permitable_in_role_ids into permitable_in_role_id;
while no_more_records = 0 do
call recursive_get_securableitem_actual_permissions_for_permitable (_securableitem_id, permitable_in_role_id, class_name, module_name, user_allow_permissions, user_deny_permissions);
call recursive_get_securableitem_propagated_allow_permissions_permit(_securableitem_id, permitable_in_role_id, class_name, module_name, propagated_allow_permissions);
set allow_permissions =
allow_permissions |
(user_allow_permissions & ~user_deny_permissions) |
propagated_allow_permissions;
fetch permitable_in_role_ids into permitable_in_role_id;
end while;
end;
set no_more_records = 0;
fetch sub_role_ids into sub_role_id;
end while;
close sub_role_ids;
end;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_get_user_actual_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_get_user_actual_right`(
in _user_id int(11),
in module_name varchar(255),
in right_name varchar(255),
out result tinyint
)
begin
declare _role_id int;
set result = 0;
begin
select role_id
into _role_id
from _user
where _user.id = _user_id;
if _role_id is not null then
call recursive_get_user_role_propagated_actual_allow_right(_role_id, module_name, right_name, result);
set result = result & 1;
end if;
end;
select get_user_explicit_actual_right (_user_id, module_name, right_name) |
get_user_inherited_actual_right(_user_id, module_name, right_name) |
result
into result;
if (result & 2) = 2 then
set result = 2;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_get_user_role_propagated_actual_allow_right` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_get_user_role_propagated_actual_allow_right`(
in _role_id int(11),
in module_name varchar(255),
in right_name varchar(255),
out result tinyint
)
begin
declare sub_role_id int(11);
declare no_more_records tinyint default 0;
declare sub_role_ids cursor for
select id
from role
where role.role_id = _role_id;
declare continue handler for not found
set no_more_records = 1;
set result = 0;
open sub_role_ids;
fetch sub_role_ids into sub_role_id;
while result = 0 and no_more_records = 0 do
begin
declare _user_id int(11);
declare _user_ids cursor for
select id
from _user
where _user.role_id = sub_role_id;
open _user_ids;
fetch _user_ids into _user_id;
while result = 0 and no_more_records = 0 do
call recursive_get_user_actual_right(_user_id, module_name, right_name, result);
fetch _user_ids into _user_id;
end while;
close _user_ids;
if result = 0 then
call recursive_get_user_role_propagated_actual_allow_right(sub_role_id, module_name, right_name, result);
end if;
set no_more_records = 0;
fetch sub_role_ids into sub_role_id;
end;
end while;
close sub_role_ids;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_group_contains_group` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_group_contains_group`(
in group_id_1 int(11),
in group_id_2 int(11),
out result tinyint
)
begin
declare group_2_parent_group_id, child_group_id int(11);
declare no_more_records tinyint default 0;
declare child_group_ids cursor for
select id
from _group
where _group._group_id = group_id_1;
declare continue handler for not found
set no_more_records = 1;
set result = 0;
if group_id_1 = group_id_2 then
set result = 1;
else # Not Coding Standard
select _group_id
into group_2_parent_group_id
from _group
where id = group_id_2;
if group_id_1 = group_2_parent_group_id then
set result = 1;
else # Not Coding Standard
open child_group_ids;
fetch child_group_ids into child_group_id;
while result = 0 and no_more_records = 0 do
call recursive_group_contains_user(child_group_id, group_id_2, result);
fetch child_group_ids into child_group_id;
end while;
close child_group_ids;
end if;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `recursive_group_contains_user` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `recursive_group_contains_user`(
in _group_id int(11),
in _user_id int(11),
out result tinyint
)
begin
declare child_group_id, count tinyint;
declare no_more_records tinyint default 0;
declare child_group_ids cursor for
select id
from _group
where _group._group_id = _group_id;
declare continue handler for not found
set no_more_records = 1;
set result = 0;
select count(*)
into count
from _group__user
where _group__user._group_id = _group_id and
_group__user._user_id = _user_id;
if count > 0 then
set result = 1;
else # Not Coding Standard
open child_group_ids;
fetch child_group_ids into child_group_id;
while result = 0 and no_more_records = 0 do
call recursive_group_contains_user(child_group_id, _user_id, result);
fetch child_group_ids into child_group_id;
end while;
close child_group_ids;
end if;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `update_email_message_for_sending` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE PROCEDURE `update_email_message_for_sending`(message_id int, send_attempts int, sent_datetime datetime,
folder_id int, error_serialized_data text, now_timestamp datetime)
begin
set @emailMessageSendErrorId = null;
delete from `emailmessagesenderror`
where id = (select error_emailmessagesenderror_id
from `emailmessage`
where id = message_id);
if (error_serialized_data is not null) then
insert into `emailmessagesenderror` ( id, `createddatetime`,`serializeddata` ) values
(null, now_timestamp , error_serialized_data);
set @emailMessageSendErrorId = last_insert_id();
end if;
update `emailmessage` set
`sendattempts` = send_attempts,
`sentdatetime` = sent_datetime,
`folder_emailfolder_id` = folder_id,
`error_emailmessagesenderror_id` = @emailMessageSendErrorId
where id = message_id;
end ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on [[regtime]]