schema.php 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * Abstract schema for CakePHP tests.
  5. *
  6. * This format resembles the existing fixture schema
  7. * and is converted to SQL via the Schema generation
  8. * features of the Database package.
  9. */
  10. return [
  11. 'binary_uuid_items' => [
  12. 'columns' => [
  13. 'id' => [
  14. 'type' => 'binaryuuid',
  15. ],
  16. 'name' => [
  17. 'type' => 'string',
  18. 'null' => false,
  19. ],
  20. 'published' => [
  21. 'type' => 'boolean',
  22. 'null' => false,
  23. ],
  24. ],
  25. 'constraints' => [
  26. 'primary' => [
  27. 'type' => 'primary',
  28. 'columns' => [
  29. 'id',
  30. ],
  31. ],
  32. ],
  33. ],
  34. 'unique_authors' => [
  35. 'columns' => [
  36. 'id' => [
  37. 'type' => 'integer',
  38. ],
  39. 'first_author_id' => [
  40. 'type' => 'integer',
  41. 'null' => true,
  42. ],
  43. 'second_author_id' => [
  44. 'type' => 'integer',
  45. 'null' => false,
  46. ],
  47. ],
  48. 'constraints' => [
  49. 'primary' => [
  50. 'type' => 'primary',
  51. 'columns' => [
  52. 'id',
  53. ],
  54. ],
  55. 'nullable_non_nullable_unique' => [
  56. 'type' => 'unique',
  57. 'columns' => [
  58. 'first_author_id',
  59. 'second_author_id',
  60. ],
  61. ],
  62. ],
  63. ],
  64. 'articles_more_translations' => [
  65. 'columns' => [
  66. 'id' => [
  67. 'type' => 'integer',
  68. ],
  69. 'locale' => [
  70. 'type' => 'string',
  71. 'null' => false,
  72. ],
  73. 'title' => [
  74. 'type' => 'string',
  75. 'null' => false,
  76. ],
  77. 'subtitle' => [
  78. 'type' => 'string',
  79. 'null' => false,
  80. ],
  81. 'body' => 'text',
  82. ],
  83. 'constraints' => [
  84. 'primary' => [
  85. 'type' => 'primary',
  86. 'columns' => [
  87. 'id',
  88. 'locale',
  89. ],
  90. ],
  91. ],
  92. ],
  93. 'users' => [
  94. 'columns' => [
  95. 'id' => [
  96. 'type' => 'integer',
  97. ],
  98. 'username' => [
  99. 'type' => 'string',
  100. 'null' => true,
  101. ],
  102. 'password' => [
  103. 'type' => 'string',
  104. 'null' => true,
  105. ],
  106. 'created' => [
  107. 'type' => 'timestamp',
  108. 'null' => true,
  109. ],
  110. 'updated' => [
  111. 'type' => 'timestamp',
  112. 'null' => true,
  113. ],
  114. ],
  115. 'constraints' => [
  116. 'primary' => [
  117. 'type' => 'primary',
  118. 'columns' => [
  119. 'id',
  120. ],
  121. ],
  122. ],
  123. ],
  124. 'featured_tags' => [
  125. 'columns' => [
  126. 'tag_id' => [
  127. 'type' => 'integer',
  128. 'null' => false,
  129. ],
  130. 'priority' => [
  131. 'type' => 'integer',
  132. 'null' => false,
  133. ],
  134. ],
  135. 'constraints' => [
  136. 'primary' => [
  137. 'type' => 'primary',
  138. 'columns' => [
  139. 'tag_id',
  140. ],
  141. ],
  142. ],
  143. ],
  144. 'column_schema_aware_type_values' => [
  145. 'columns' => [
  146. 'id' => [
  147. 'type' => 'integer',
  148. ],
  149. 'val' => [
  150. 'type' => 'text',
  151. 'null' => false,
  152. 'comment' => 'Fixture comment',
  153. ],
  154. ],
  155. 'constraints' => [
  156. 'primary' => [
  157. 'type' => 'primary',
  158. 'columns' => [
  159. 'id',
  160. ],
  161. ],
  162. ],
  163. ],
  164. 'sections_members' => [
  165. 'columns' => [
  166. 'id' => [
  167. 'type' => 'integer',
  168. ],
  169. 'section_id' => [
  170. 'type' => 'integer',
  171. ],
  172. 'member_id' => [
  173. 'type' => 'integer',
  174. ],
  175. ],
  176. 'constraints' => [
  177. 'primary' => [
  178. 'type' => 'primary',
  179. 'columns' => [
  180. 'id',
  181. ],
  182. ],
  183. ],
  184. ],
  185. 'site_articles_tags' => [
  186. 'columns' => [
  187. 'article_id' => [
  188. 'type' => 'integer',
  189. 'null' => false,
  190. ],
  191. 'tag_id' => [
  192. 'type' => 'integer',
  193. 'null' => false,
  194. ],
  195. 'site_id' => [
  196. 'type' => 'integer',
  197. 'null' => false,
  198. ],
  199. ],
  200. 'constraints' => [
  201. 'UNIQUE_TAG2' => [
  202. 'type' => 'primary',
  203. 'columns' => [
  204. 'article_id',
  205. 'tag_id',
  206. 'site_id',
  207. ],
  208. ],
  209. ],
  210. ],
  211. 'authors_translations' => [
  212. 'columns' => [
  213. 'id' => [
  214. 'type' => 'integer',
  215. ],
  216. 'locale' => [
  217. 'type' => 'string',
  218. 'null' => false,
  219. ],
  220. 'name' => [
  221. 'type' => 'string',
  222. 'null' => false,
  223. ],
  224. ],
  225. 'constraints' => [
  226. 'primary' => [
  227. 'type' => 'primary',
  228. 'columns' => [
  229. 'id',
  230. 'locale',
  231. ],
  232. ],
  233. ],
  234. ],
  235. 'binary_uuid_items_binary_uuid_tags' => [
  236. 'columns' => [
  237. 'id' => [
  238. 'type' => 'integer',
  239. ],
  240. 'binary_uuid_item_id' => [
  241. 'type' => 'binaryuuid',
  242. 'null' => false,
  243. ],
  244. 'binary_uuid_tag_id' => [
  245. 'type' => 'binaryuuid',
  246. 'null' => false,
  247. ],
  248. ],
  249. 'constraints' => [
  250. 'primary' => [
  251. 'type' => 'primary',
  252. 'columns' => [
  253. 'id',
  254. ],
  255. ],
  256. 'unique_item_tag' => [
  257. 'type' => 'unique',
  258. 'columns' => [
  259. 'binary_uuid_item_id',
  260. 'binary_uuid_tag_id',
  261. ],
  262. ],
  263. ],
  264. ],
  265. 'auth_users' => [
  266. 'columns' => [
  267. 'id' => [
  268. 'type' => 'integer',
  269. ],
  270. 'username' => [
  271. 'type' => 'string',
  272. 'null' => false,
  273. ],
  274. 'password' => [
  275. 'type' => 'string',
  276. 'null' => false,
  277. ],
  278. 'created' => 'datetime',
  279. 'updated' => 'datetime',
  280. ],
  281. 'constraints' => [
  282. 'primary' => [
  283. 'type' => 'primary',
  284. 'columns' => [
  285. 'id',
  286. ],
  287. ],
  288. ],
  289. ],
  290. 'counter_cache_categories' => [
  291. 'columns' => [
  292. 'id' => [
  293. 'type' => 'integer',
  294. ],
  295. 'name' => [
  296. 'type' => 'string',
  297. 'length' => 255,
  298. 'null' => false,
  299. ],
  300. 'post_count' => [
  301. 'type' => 'integer',
  302. 'null' => true,
  303. ],
  304. ],
  305. 'constraints' => [
  306. 'primary' => [
  307. 'type' => 'primary',
  308. 'columns' => [
  309. 'id',
  310. ],
  311. ],
  312. ],
  313. ],
  314. 'date_keys' => [
  315. 'columns' => [
  316. 'id' => [
  317. 'type' => 'date',
  318. ],
  319. 'title' => [
  320. 'type' => 'string',
  321. 'null' => true,
  322. ],
  323. ],
  324. 'constraints' => [
  325. 'primary' => [
  326. 'type' => 'primary',
  327. 'columns' => [
  328. 'id',
  329. ],
  330. ],
  331. ],
  332. ],
  333. 'counter_cache_posts' => [
  334. 'columns' => [
  335. 'id' => [
  336. 'type' => 'integer',
  337. ],
  338. 'title' => [
  339. 'type' => 'string',
  340. 'length' => 255,
  341. ],
  342. 'user_id' => [
  343. 'type' => 'integer',
  344. 'null' => true,
  345. ],
  346. 'category_id' => [
  347. 'type' => 'integer',
  348. 'null' => true,
  349. ],
  350. 'published' => [
  351. 'type' => 'boolean',
  352. 'null' => false,
  353. 'default' => false,
  354. ],
  355. ],
  356. 'constraints' => [
  357. 'primary' => [
  358. 'type' => 'primary',
  359. 'columns' => [
  360. 'id',
  361. ],
  362. ],
  363. ],
  364. ],
  365. 'test_plugin_comments' => [
  366. 'columns' => [
  367. 'id' => [
  368. 'type' => 'integer',
  369. ],
  370. 'article_id' => [
  371. 'type' => 'integer',
  372. 'null' => false,
  373. ],
  374. 'user_id' => [
  375. 'type' => 'integer',
  376. 'null' => false,
  377. ],
  378. 'comment' => 'text',
  379. 'published' => [
  380. 'type' => 'string',
  381. 'length' => 1,
  382. 'default' => 'N',
  383. ],
  384. 'created' => 'datetime',
  385. 'updated' => 'datetime',
  386. ],
  387. 'constraints' => [
  388. 'primary' => [
  389. 'type' => 'primary',
  390. 'columns' => [
  391. 'id',
  392. ],
  393. ],
  394. ],
  395. ],
  396. 'members' => [
  397. 'columns' => [
  398. 'id' => [
  399. 'type' => 'integer',
  400. ],
  401. 'section_count' => [
  402. 'type' => 'integer',
  403. ],
  404. ],
  405. 'constraints' => [
  406. 'primary' => [
  407. 'type' => 'primary',
  408. 'columns' => [
  409. 'id',
  410. ],
  411. ],
  412. ],
  413. ],
  414. 'uuid_items' => [
  415. 'columns' => [
  416. 'id' => [
  417. 'type' => 'uuid',
  418. ],
  419. 'published' => [
  420. 'type' => 'boolean',
  421. 'null' => false,
  422. ],
  423. 'name' => [
  424. 'type' => 'string',
  425. 'null' => false,
  426. ],
  427. ],
  428. 'constraints' => [
  429. 'primary' => [
  430. 'type' => 'primary',
  431. 'columns' => [
  432. 'id',
  433. ],
  434. ],
  435. ],
  436. ],
  437. 'special_tags_translations' => [
  438. 'columns' => [
  439. 'id' => [
  440. 'type' => 'integer',
  441. ],
  442. 'locale' => [
  443. 'type' => 'string',
  444. 'null' => false,
  445. ],
  446. 'extra_info' => [
  447. 'type' => 'string',
  448. ],
  449. ],
  450. 'constraints' => [
  451. 'primary' => [
  452. 'type' => 'primary',
  453. 'columns' => [
  454. 'id',
  455. 'locale',
  456. ],
  457. ],
  458. ],
  459. ],
  460. 'articles' => [
  461. 'columns' => [
  462. 'id' => [
  463. 'type' => 'integer',
  464. ],
  465. 'author_id' => [
  466. 'type' => 'integer',
  467. 'null' => true,
  468. ],
  469. 'title' => [
  470. 'type' => 'string',
  471. 'null' => true,
  472. ],
  473. 'body' => 'text',
  474. 'published' => [
  475. 'type' => 'string',
  476. 'length' => 1,
  477. 'default' => 'N',
  478. ],
  479. ],
  480. 'constraints' => [
  481. 'primary' => [
  482. 'type' => 'primary',
  483. 'columns' => [
  484. 'id',
  485. ],
  486. ],
  487. ],
  488. ],
  489. 'articles_translations' => [
  490. 'columns' => [
  491. 'id' => [
  492. 'type' => 'integer',
  493. ],
  494. 'locale' => [
  495. 'type' => 'string',
  496. 'null' => false,
  497. ],
  498. 'title' => [
  499. 'type' => 'string',
  500. 'null' => true,
  501. ],
  502. 'body' => 'text',
  503. ],
  504. 'constraints' => [
  505. 'primary' => [
  506. 'type' => 'primary',
  507. 'columns' => [
  508. 'id',
  509. 'locale',
  510. ],
  511. ],
  512. ],
  513. ],
  514. 'products' => [
  515. 'columns' => [
  516. 'id' => [
  517. 'type' => 'integer',
  518. ],
  519. 'category' => [
  520. 'type' => 'integer',
  521. 'null' => false,
  522. ],
  523. 'name' => [
  524. 'type' => 'string',
  525. 'null' => false,
  526. ],
  527. 'price' => [
  528. 'type' => 'integer',
  529. ],
  530. ],
  531. 'constraints' => [
  532. 'primary' => [
  533. 'type' => 'primary',
  534. 'columns' => [
  535. 'category',
  536. 'id',
  537. ],
  538. ],
  539. ],
  540. ],
  541. 'orders' => [
  542. 'columns' => [
  543. 'id' => [
  544. 'type' => 'integer',
  545. ],
  546. 'product_category' => [
  547. 'type' => 'integer',
  548. 'null' => false,
  549. ],
  550. 'product_id' => [
  551. 'type' => 'integer',
  552. 'null' => false,
  553. ],
  554. ],
  555. 'constraints' => [
  556. 'primary' => [
  557. 'type' => 'primary',
  558. 'columns' => [
  559. 'id',
  560. ],
  561. ],
  562. 'product_category_fk' => [
  563. 'type' => 'foreign',
  564. 'columns' => [
  565. 'product_category',
  566. 'product_id',
  567. ],
  568. 'references' => [
  569. 'products',
  570. [
  571. 'category',
  572. 'id',
  573. ],
  574. ],
  575. 'update' => 'cascade',
  576. 'delete' => 'cascade',
  577. ],
  578. ],
  579. 'indexes' => [
  580. 'product_category' => [
  581. 'type' => 'index',
  582. 'columns' => [
  583. 'product_category',
  584. 'product_id',
  585. ],
  586. ],
  587. ],
  588. ],
  589. 'comments' => [
  590. 'columns' => [
  591. 'id' => [
  592. 'type' => 'integer',
  593. ],
  594. 'article_id' => [
  595. 'type' => 'integer',
  596. 'null' => false,
  597. ],
  598. 'user_id' => [
  599. 'type' => 'integer',
  600. 'null' => false,
  601. ],
  602. 'comment' => [
  603. 'type' => 'text',
  604. ],
  605. 'published' => [
  606. 'type' => 'string',
  607. 'length' => 1,
  608. 'default' => 'N',
  609. ],
  610. 'created' => [
  611. 'type' => 'datetime',
  612. ],
  613. 'updated' => [
  614. 'type' => 'datetime',
  615. ],
  616. ],
  617. 'constraints' => [
  618. 'primary' => [
  619. 'type' => 'primary',
  620. 'columns' => [
  621. 'id',
  622. ],
  623. ],
  624. ],
  625. ],
  626. 'datatypes' => [
  627. 'columns' => [
  628. 'id' => [
  629. 'type' => 'biginteger',
  630. ],
  631. 'cost' => [
  632. 'type' => 'decimal',
  633. 'length' => 20,
  634. 'precision' => 1,
  635. 'null' => true,
  636. ],
  637. 'fraction' => [
  638. 'type' => 'decimal',
  639. 'length' => 20,
  640. 'precision' => 19,
  641. 'null' => true,
  642. ],
  643. 'floaty' => [
  644. 'type' => 'float',
  645. 'null' => true,
  646. ],
  647. 'small' => [
  648. 'type' => 'smallinteger',
  649. 'null' => true,
  650. ],
  651. 'tiny' => [
  652. 'type' => 'tinyinteger',
  653. 'null' => true,
  654. ],
  655. ],
  656. 'constraints' => [
  657. 'primary' => [
  658. 'type' => 'primary',
  659. 'columns' => [
  660. 'id',
  661. ],
  662. ],
  663. ],
  664. ],
  665. 'authors' => [
  666. 'columns' => [
  667. 'id' => [
  668. 'type' => 'integer',
  669. ],
  670. 'name' => [
  671. 'type' => 'string',
  672. 'default' => null,
  673. ],
  674. ],
  675. 'constraints' => [
  676. 'primary' => [
  677. 'type' => 'primary',
  678. 'columns' => [
  679. 'id',
  680. ],
  681. ],
  682. ],
  683. ],
  684. 'counter_cache_comments' => [
  685. 'columns' => [
  686. 'id' => [
  687. 'type' => 'integer',
  688. ],
  689. 'title' => [
  690. 'type' => 'string',
  691. 'length' => 255,
  692. ],
  693. 'user_id' => [
  694. 'type' => 'integer',
  695. 'null' => true,
  696. ],
  697. ],
  698. 'constraints' => [
  699. 'primary' => [
  700. 'type' => 'primary',
  701. 'columns' => [
  702. 'id',
  703. ],
  704. ],
  705. ],
  706. ],
  707. 'special_tags' => [
  708. 'columns' => [
  709. 'id' => [
  710. 'type' => 'integer',
  711. ],
  712. 'article_id' => [
  713. 'type' => 'integer',
  714. 'null' => false,
  715. ],
  716. 'tag_id' => [
  717. 'type' => 'integer',
  718. 'null' => false,
  719. ],
  720. 'highlighted' => [
  721. 'type' => 'boolean',
  722. 'null' => true,
  723. ],
  724. 'highlighted_time' => [
  725. 'type' => 'timestamp',
  726. 'null' => true,
  727. ],
  728. 'extra_info' => [
  729. 'type' => 'string',
  730. ],
  731. 'author_id' => [
  732. 'type' => 'integer',
  733. 'null' => true,
  734. ],
  735. ],
  736. 'constraints' => [
  737. 'primary' => [
  738. 'type' => 'primary',
  739. 'columns' => [
  740. 'id',
  741. ],
  742. ],
  743. 'UNIQUE_TAG2' => [
  744. 'type' => 'unique',
  745. 'columns' => [
  746. 'article_id',
  747. 'tag_id',
  748. ],
  749. ],
  750. ],
  751. ],
  752. 'ordered_uuid_items' => [
  753. 'columns' => [
  754. 'id' => [
  755. 'type' => 'string',
  756. 'length' => 32,
  757. ],
  758. 'published' => [
  759. 'type' => 'boolean',
  760. 'null' => false,
  761. ],
  762. 'name' => [
  763. 'type' => 'string',
  764. 'null' => false,
  765. ],
  766. ],
  767. 'constraints' => [
  768. 'primary' => [
  769. 'type' => 'primary',
  770. 'columns' => [
  771. 'id',
  772. ],
  773. ],
  774. ],
  775. ],
  776. 'counter_cache_users' => [
  777. 'columns' => [
  778. 'id' => [
  779. 'type' => 'integer',
  780. ],
  781. 'name' => [
  782. 'type' => 'string',
  783. 'length' => 255,
  784. 'null' => false,
  785. ],
  786. 'post_count' => [
  787. 'type' => 'integer',
  788. 'null' => true,
  789. ],
  790. 'comment_count' => [
  791. 'type' => 'integer',
  792. 'null' => true,
  793. ],
  794. 'posts_published' => [
  795. 'type' => 'integer',
  796. 'null' => true,
  797. ],
  798. ],
  799. 'constraints' => [
  800. 'primary' => [
  801. 'type' => 'primary',
  802. 'columns' => [
  803. 'id',
  804. ],
  805. ],
  806. ],
  807. ],
  808. 'tags' => [
  809. 'columns' => [
  810. 'id' => [
  811. 'type' => 'integer',
  812. 'null' => false,
  813. ],
  814. 'name' => [
  815. 'type' => 'string',
  816. 'null' => false,
  817. ],
  818. 'description' => [
  819. 'type' => 'text',
  820. 'length' => 16777215,
  821. ],
  822. 'created' => [
  823. 'type' => 'datetime',
  824. 'null' => true,
  825. 'default' => null,
  826. ],
  827. ],
  828. 'constraints' => [
  829. 'primary' => [
  830. 'type' => 'primary',
  831. 'columns' => [
  832. 'id',
  833. ],
  834. ],
  835. ],
  836. ],
  837. 'articles_tags' => [
  838. 'columns' => [
  839. 'article_id' => [
  840. 'type' => 'integer',
  841. 'null' => false,
  842. ],
  843. 'tag_id' => [
  844. 'type' => 'integer',
  845. 'null' => false,
  846. ],
  847. ],
  848. 'constraints' => [
  849. 'unique_tag' => [
  850. 'type' => 'primary',
  851. 'columns' => [
  852. 'article_id',
  853. 'tag_id',
  854. ],
  855. ],
  856. 'tag_id_fk' => [
  857. 'type' => 'foreign',
  858. 'columns' => [
  859. 'tag_id',
  860. ],
  861. 'references' => [
  862. 'tags',
  863. 'id',
  864. ],
  865. 'update' => 'cascade',
  866. 'delete' => 'cascade',
  867. ],
  868. ],
  869. ],
  870. 'articles_tags_binding_keys' => [
  871. 'columns' => [
  872. 'article_id' => [
  873. 'type' => 'integer',
  874. 'null' => false,
  875. ],
  876. 'tagname' => [
  877. 'type' => 'string',
  878. 'null' => false,
  879. ],
  880. ],
  881. 'constraints' => [
  882. 'unique_tag' => [
  883. 'type' => 'primary',
  884. 'columns' => [
  885. 'article_id',
  886. 'tagname',
  887. ],
  888. ],
  889. ],
  890. ],
  891. 'composite_key_articles' => [
  892. 'columns' => [
  893. 'author_id' => [
  894. 'type' => 'integer',
  895. 'null' => false,
  896. ],
  897. 'created' => [
  898. 'type' => 'datetime',
  899. 'null' => false,
  900. ],
  901. 'body' => [
  902. 'type' => 'text',
  903. ],
  904. ],
  905. 'constraints' => [
  906. 'composite_article_pk' => [
  907. 'type' => 'primary',
  908. 'columns' => [
  909. 'author_id',
  910. 'created',
  911. ],
  912. ],
  913. ],
  914. ],
  915. 'composite_key_articles_tags' => [
  916. 'columns' => [
  917. 'author_id' => [
  918. 'type' => 'integer',
  919. 'null' => false,
  920. ],
  921. 'created' => [
  922. 'type' => 'datetime',
  923. 'null' => false,
  924. ],
  925. 'tag_id' => [
  926. 'type' => 'integer',
  927. 'null' => false,
  928. ],
  929. ],
  930. 'constraints' => [
  931. 'composite_article_tags_pk' => [
  932. 'type' => 'primary',
  933. 'columns' => [
  934. 'author_id',
  935. 'created',
  936. 'tag_id',
  937. ],
  938. ],
  939. ],
  940. ],
  941. 'profiles' => [
  942. 'columns' => [
  943. 'id' => [
  944. 'type' => 'integer',
  945. 'null' => false,
  946. 'autoIncrement' => true,
  947. ],
  948. 'user_id' => [
  949. 'type' => 'integer',
  950. 'null' => false,
  951. ],
  952. 'first_name' => [
  953. 'type' => 'string',
  954. 'null' => true,
  955. ],
  956. 'last_name' => [
  957. 'type' => 'string',
  958. 'null' => true,
  959. ],
  960. 'is_active' => [
  961. 'type' => 'boolean',
  962. 'null' => false,
  963. 'default' => true,
  964. ],
  965. ],
  966. 'constraints' => [
  967. 'primary' => [
  968. 'type' => 'primary',
  969. 'columns' => [
  970. 'id',
  971. ],
  972. ],
  973. ],
  974. ],
  975. 'sessions' => [
  976. 'columns' => [
  977. 'id' => [
  978. 'type' => 'string',
  979. 'length' => 128,
  980. ],
  981. 'data' => [
  982. 'type' => 'binary',
  983. 'length' => 16777215,
  984. 'null' => true,
  985. ],
  986. 'expires' => [
  987. 'type' => 'integer',
  988. 'length' => 11,
  989. 'null' => true,
  990. ],
  991. ],
  992. 'constraints' => [
  993. 'primary' => [
  994. 'type' => 'primary',
  995. 'columns' => [
  996. 'id',
  997. ],
  998. ],
  999. ],
  1000. ],
  1001. 'comments_translations' => [
  1002. 'columns' => [
  1003. 'id' => [
  1004. 'type' => 'integer',
  1005. ],
  1006. 'locale' => [
  1007. 'type' => 'string',
  1008. 'null' => false,
  1009. ],
  1010. 'comment' => 'text',
  1011. ],
  1012. 'constraints' => [
  1013. 'primary' => [
  1014. 'type' => 'primary',
  1015. 'columns' => [
  1016. 'id',
  1017. 'locale',
  1018. ],
  1019. ],
  1020. ],
  1021. ],
  1022. 'menu_link_trees' => [
  1023. 'columns' => [
  1024. 'id' => [
  1025. 'type' => 'integer',
  1026. ],
  1027. 'menu' => [
  1028. 'type' => 'string',
  1029. 'null' => false,
  1030. ],
  1031. 'lft' => [
  1032. 'type' => 'integer',
  1033. ],
  1034. 'rght' => [
  1035. 'type' => 'integer',
  1036. ],
  1037. 'parent_id' => 'integer',
  1038. 'url' => [
  1039. 'type' => 'string',
  1040. 'null' => false,
  1041. ],
  1042. 'title' => [
  1043. 'type' => 'string',
  1044. 'null' => false,
  1045. ],
  1046. ],
  1047. 'constraints' => [
  1048. 'primary' => [
  1049. 'type' => 'primary',
  1050. 'columns' => [
  1051. 'id',
  1052. ],
  1053. ],
  1054. ],
  1055. ],
  1056. 'polymorphic_tagged' => [
  1057. 'columns' => [
  1058. 'id' => [
  1059. 'type' => 'integer',
  1060. ],
  1061. 'tag_id' => [
  1062. 'type' => 'integer',
  1063. ],
  1064. 'foreign_key' => [
  1065. 'type' => 'integer',
  1066. ],
  1067. 'foreign_model' => [
  1068. 'type' => 'string',
  1069. ],
  1070. 'position' => [
  1071. 'type' => 'integer',
  1072. 'null' => true,
  1073. ],
  1074. ],
  1075. 'constraints' => [
  1076. 'primary' => [
  1077. 'type' => 'primary',
  1078. 'columns' => [
  1079. 'id',
  1080. ],
  1081. ],
  1082. ],
  1083. ],
  1084. 'things' => [
  1085. 'columns' => [
  1086. 'id' => [
  1087. 'type' => 'integer',
  1088. ],
  1089. 'title' => [
  1090. 'type' => 'string',
  1091. 'length' => 20,
  1092. ],
  1093. 'body' => [
  1094. 'type' => 'string',
  1095. 'length' => 50,
  1096. ],
  1097. ],
  1098. ],
  1099. 'site_articles' => [
  1100. 'columns' => [
  1101. 'id' => [
  1102. 'type' => 'integer',
  1103. ],
  1104. 'author_id' => [
  1105. 'type' => 'integer',
  1106. 'null' => true,
  1107. ],
  1108. 'site_id' => [
  1109. 'type' => 'integer',
  1110. 'null' => false,
  1111. ],
  1112. 'title' => [
  1113. 'type' => 'string',
  1114. 'null' => true,
  1115. ],
  1116. 'body' => 'text',
  1117. ],
  1118. 'constraints' => [
  1119. 'primary' => [
  1120. 'type' => 'primary',
  1121. 'columns' => [
  1122. 'id',
  1123. 'site_id',
  1124. ],
  1125. ],
  1126. ],
  1127. ],
  1128. 'sections_translations' => [
  1129. 'columns' => [
  1130. 'id' => [
  1131. 'type' => 'integer',
  1132. ],
  1133. 'locale' => [
  1134. 'type' => 'string',
  1135. 'null' => false,
  1136. ],
  1137. 'title' => [
  1138. 'type' => 'string',
  1139. ],
  1140. ],
  1141. 'constraints' => [
  1142. 'primary' => [
  1143. 'type' => 'primary',
  1144. 'columns' => [
  1145. 'id',
  1146. 'locale',
  1147. ],
  1148. ],
  1149. ],
  1150. ],
  1151. 'authors_tags' => [
  1152. 'columns' => [
  1153. 'author_id' => [
  1154. 'type' => 'integer',
  1155. 'null' => false,
  1156. ],
  1157. 'tag_id' => [
  1158. 'type' => 'integer',
  1159. 'null' => false,
  1160. ],
  1161. ],
  1162. 'constraints' => [
  1163. 'unique_tag' => [
  1164. 'type' => 'primary',
  1165. 'columns' => [
  1166. 'author_id',
  1167. 'tag_id',
  1168. ],
  1169. ],
  1170. 'author_id_fk' => [
  1171. 'type' => 'foreign',
  1172. 'columns' => ['author_id'],
  1173. 'references' => ['authors', 'id'],
  1174. 'update' => 'cascade',
  1175. 'delete' => 'cascade',
  1176. ],
  1177. ],
  1178. ],
  1179. 'site_authors' => [
  1180. 'columns' => [
  1181. 'id' => [
  1182. 'type' => 'integer',
  1183. ],
  1184. 'name' => [
  1185. 'type' => 'string',
  1186. 'default' => null,
  1187. ],
  1188. 'site_id' => [
  1189. 'type' => 'integer',
  1190. 'null' => false,
  1191. ],
  1192. ],
  1193. 'constraints' => [
  1194. 'primary' => [
  1195. 'type' => 'primary',
  1196. 'columns' => [
  1197. 'id',
  1198. 'site_id',
  1199. ],
  1200. ],
  1201. ],
  1202. ],
  1203. 'i18n' => [
  1204. 'columns' => [
  1205. 'id' => [
  1206. 'type' => 'integer',
  1207. ],
  1208. 'locale' => [
  1209. 'type' => 'string',
  1210. 'length' => 6,
  1211. 'null' => false,
  1212. ],
  1213. 'model' => [
  1214. 'type' => 'string',
  1215. 'null' => false,
  1216. ],
  1217. 'foreign_key' => [
  1218. 'type' => 'integer',
  1219. 'null' => false,
  1220. ],
  1221. 'field' => [
  1222. 'type' => 'string',
  1223. 'null' => false,
  1224. ],
  1225. 'content' => [
  1226. 'type' => 'text',
  1227. ],
  1228. ],
  1229. 'constraints' => [
  1230. 'primary' => [
  1231. 'type' => 'primary',
  1232. 'columns' => [
  1233. 'id',
  1234. ],
  1235. ],
  1236. ],
  1237. ],
  1238. 'number_trees' => [
  1239. 'columns' => [
  1240. 'id' => [
  1241. 'type' => 'integer',
  1242. ],
  1243. 'name' => [
  1244. 'type' => 'string',
  1245. 'null' => false,
  1246. ],
  1247. 'parent_id' => 'integer',
  1248. 'lft' => [
  1249. 'type' => 'integer',
  1250. ],
  1251. 'rght' => [
  1252. 'type' => 'integer',
  1253. ],
  1254. 'depth' => [
  1255. 'type' => 'integer',
  1256. ],
  1257. ],
  1258. 'constraints' => [
  1259. 'primary' => [
  1260. 'type' => 'primary',
  1261. 'columns' => [
  1262. 'id',
  1263. ],
  1264. ],
  1265. ],
  1266. ],
  1267. 'number_trees_articles' => [
  1268. 'columns' => [
  1269. 'id' => [
  1270. 'type' => 'integer',
  1271. ],
  1272. 'number_tree_id' => [
  1273. 'type' => 'integer',
  1274. 'null' => true,
  1275. ],
  1276. 'title' => [
  1277. 'type' => 'string',
  1278. 'null' => true,
  1279. ],
  1280. 'body' => 'text',
  1281. 'published' => [
  1282. 'type' => 'string',
  1283. 'length' => 1,
  1284. 'default' => 'N',
  1285. ],
  1286. ],
  1287. 'constraints' => [
  1288. 'primary' => [
  1289. 'type' => 'primary',
  1290. 'columns' => [
  1291. 'id',
  1292. ],
  1293. ],
  1294. ],
  1295. ],
  1296. 'composite_increments' => [
  1297. 'columns' => [
  1298. 'id' => [
  1299. 'type' => 'integer',
  1300. 'null' => false,
  1301. 'autoIncrement' => true,
  1302. ],
  1303. 'account_id' => [
  1304. 'type' => 'integer',
  1305. 'null' => false,
  1306. ],
  1307. 'name' => [
  1308. 'type' => 'string',
  1309. 'default' => null,
  1310. ],
  1311. ],
  1312. 'constraints' => [
  1313. 'primary' => [
  1314. 'type' => 'primary',
  1315. 'columns' => [
  1316. 'id',
  1317. 'account_id',
  1318. ],
  1319. ],
  1320. ],
  1321. ],
  1322. 'tags_shadow_translations' => [
  1323. 'columns' => [
  1324. 'id' => [
  1325. 'type' => 'integer',
  1326. ],
  1327. 'locale' => [
  1328. 'type' => 'string',
  1329. 'null' => false,
  1330. ],
  1331. 'name' => [
  1332. 'type' => 'string',
  1333. 'null' => false,
  1334. ],
  1335. ],
  1336. 'constraints' => [
  1337. 'primary' => [
  1338. 'type' => 'primary',
  1339. 'columns' => [
  1340. 'id',
  1341. 'locale',
  1342. ],
  1343. ],
  1344. ],
  1345. ],
  1346. 'posts' => [
  1347. 'columns' => [
  1348. 'id' => [
  1349. 'type' => 'integer',
  1350. ],
  1351. 'author_id' => [
  1352. 'type' => 'integer',
  1353. 'null' => false,
  1354. ],
  1355. 'title' => [
  1356. 'type' => 'string',
  1357. 'null' => false,
  1358. ],
  1359. 'body' => 'text',
  1360. 'published' => [
  1361. 'type' => 'string',
  1362. 'length' => 1,
  1363. 'default' => 'N',
  1364. ],
  1365. ],
  1366. 'constraints' => [
  1367. 'primary' => [
  1368. 'type' => 'primary',
  1369. 'columns' => [
  1370. 'id',
  1371. ],
  1372. ],
  1373. ],
  1374. ],
  1375. 'binary_uuid_tags' => [
  1376. 'columns' => [
  1377. 'id' => [
  1378. 'type' => 'binaryuuid',
  1379. ],
  1380. 'name' => [
  1381. 'type' => 'string',
  1382. 'null' => false,
  1383. ],
  1384. ],
  1385. 'constraints' => [
  1386. 'primary' => [
  1387. 'type' => 'primary',
  1388. 'columns' => [
  1389. 'id',
  1390. ],
  1391. ],
  1392. ],
  1393. ],
  1394. 'tags_translations' => [
  1395. 'columns' => [
  1396. 'id' => [
  1397. 'type' => 'integer',
  1398. 'null' => false,
  1399. 'autoIncrement' => true,
  1400. ],
  1401. 'locale' => [
  1402. 'type' => 'string',
  1403. 'null' => false,
  1404. ],
  1405. 'name' => [
  1406. 'type' => 'string',
  1407. 'null' => false,
  1408. ],
  1409. ],
  1410. 'constraints' => [
  1411. 'primary' => [
  1412. 'type' => 'primary',
  1413. 'columns' => [
  1414. 'id',
  1415. ],
  1416. ],
  1417. ],
  1418. ],
  1419. 'cake_sessions' => [
  1420. 'columns' => [
  1421. 'id' => [
  1422. 'type' => 'string',
  1423. 'length' => 128,
  1424. ],
  1425. 'data' => [
  1426. 'type' => 'text',
  1427. 'null' => true,
  1428. ],
  1429. 'expires' => [
  1430. 'type' => 'integer',
  1431. 'length' => 11,
  1432. 'null' => true,
  1433. ],
  1434. ],
  1435. 'constraints' => [
  1436. 'primary' => [
  1437. 'type' => 'primary',
  1438. 'columns' => [
  1439. 'id',
  1440. ],
  1441. ],
  1442. ],
  1443. ],
  1444. 'attachments' => [
  1445. 'columns' => [
  1446. 'id' => [
  1447. 'type' => 'integer',
  1448. ],
  1449. 'comment_id' => [
  1450. 'type' => 'integer',
  1451. 'null' => false,
  1452. ],
  1453. 'attachment' => [
  1454. 'type' => 'string',
  1455. 'null' => false,
  1456. ],
  1457. 'created' => 'datetime',
  1458. 'updated' => 'datetime',
  1459. ],
  1460. 'constraints' => [
  1461. 'primary' => [
  1462. 'type' => 'primary',
  1463. 'columns' => [
  1464. 'id',
  1465. ],
  1466. ],
  1467. ],
  1468. ],
  1469. 'categories' => [
  1470. 'columns' => [
  1471. 'id' => [
  1472. 'type' => 'integer',
  1473. ],
  1474. 'parent_id' => [
  1475. 'type' => 'integer',
  1476. 'null' => false,
  1477. ],
  1478. 'name' => [
  1479. 'type' => 'string',
  1480. 'null' => false,
  1481. ],
  1482. 'created' => 'datetime',
  1483. 'updated' => 'datetime',
  1484. ],
  1485. 'constraints' => [
  1486. 'primary' => [
  1487. 'type' => 'primary',
  1488. 'columns' => [
  1489. 'id',
  1490. ],
  1491. ],
  1492. ],
  1493. ],
  1494. 'sections' => [
  1495. 'columns' => [
  1496. 'id' => [
  1497. 'type' => 'integer',
  1498. ],
  1499. 'title' => [
  1500. 'type' => 'string',
  1501. ],
  1502. ],
  1503. 'constraints' => [
  1504. 'primary' => [
  1505. 'type' => 'primary',
  1506. 'columns' => [
  1507. 'id',
  1508. ],
  1509. ],
  1510. ],
  1511. ],
  1512. 'counter_cache_user_category_posts' => [
  1513. 'columns' => [
  1514. 'id' => [
  1515. 'type' => 'integer',
  1516. ],
  1517. 'category_id' => [
  1518. 'type' => 'integer',
  1519. ],
  1520. 'user_id' => [
  1521. 'type' => 'integer',
  1522. ],
  1523. 'post_count' => [
  1524. 'type' => 'integer',
  1525. 'null' => true,
  1526. ],
  1527. ],
  1528. 'constraints' => [
  1529. 'primary' => [
  1530. 'type' => 'primary',
  1531. 'columns' => [
  1532. 'id',
  1533. ],
  1534. ],
  1535. ],
  1536. ],
  1537. 'site_tags' => [
  1538. 'columns' => [
  1539. 'id' => [
  1540. 'type' => 'integer',
  1541. ],
  1542. 'site_id' => [
  1543. 'type' => 'integer',
  1544. ],
  1545. 'name' => [
  1546. 'type' => 'string',
  1547. 'null' => false,
  1548. ],
  1549. ],
  1550. 'constraints' => [
  1551. 'primary' => [
  1552. 'type' => 'primary',
  1553. 'columns' => [
  1554. 'id',
  1555. 'site_id',
  1556. ],
  1557. ],
  1558. ],
  1559. ],
  1560. 'nullable_authors' => [
  1561. 'columns' => [
  1562. 'id' => [
  1563. 'type' => 'integer',
  1564. ],
  1565. 'author_id' => [
  1566. 'type' => 'integer',
  1567. 'null' => true,
  1568. ],
  1569. ],
  1570. 'constraints' => [
  1571. 'primary' => [
  1572. 'type' => 'primary',
  1573. 'columns' => [
  1574. 'id',
  1575. ],
  1576. ],
  1577. ],
  1578. ],
  1579. ];