schema.php 37 KB

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