drupal7.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. /**
  3. * @file
  4. * A database agnostic dump for testing purposes.
  5. */
  6. use Drupal\Core\Database\Database;
  7. $connection = Database::getConnection();
  8. $connection->schema()->createTable('field_group', array(
  9. 'fields' => array(
  10. 'id' => array(
  11. 'type' => 'serial',
  12. 'not null' => TRUE,
  13. 'size' => 'normal',
  14. ),
  15. 'identifier' => array(
  16. 'type' => 'varchar',
  17. 'not null' => TRUE,
  18. 'length' => '255',
  19. 'default' => '',
  20. ),
  21. 'group_name' => array(
  22. 'type' => 'varchar',
  23. 'not null' => TRUE,
  24. 'length' => '32',
  25. 'default' => '',
  26. ),
  27. 'entity_type' => array(
  28. 'type' => 'varchar',
  29. 'not null' => TRUE,
  30. 'length' => '32',
  31. 'default' => '',
  32. ),
  33. 'bundle' => array(
  34. 'type' => 'varchar',
  35. 'not null' => TRUE,
  36. 'length' => '128',
  37. 'default' => '',
  38. ),
  39. 'mode' => array(
  40. 'type' => 'varchar',
  41. 'not null' => TRUE,
  42. 'length' => '128',
  43. 'default' => '',
  44. ),
  45. 'parent_name' => array(
  46. 'type' => 'varchar',
  47. 'not null' => TRUE,
  48. 'length' => '32',
  49. 'default' => '',
  50. ),
  51. 'data' => array(
  52. 'type' => 'blob',
  53. 'not null' => TRUE,
  54. 'size' => 'big',
  55. ),
  56. ),
  57. 'primary key' => array(
  58. 'id',
  59. ),
  60. 'unique keys' => array(
  61. 'identifier' => array(
  62. 'identifier',
  63. ),
  64. ),
  65. 'indexes' => array(
  66. 'group_name' => array(
  67. 'group_name',
  68. ),
  69. ),
  70. 'mysql_character_set' => 'utf8',
  71. ));
  72. $connection->insert('field_group')
  73. ->fields(array(
  74. 'id',
  75. 'identifier',
  76. 'group_name',
  77. 'entity_type',
  78. 'bundle',
  79. 'mode',
  80. 'parent_name',
  81. 'data',
  82. ))
  83. ->values(array(
  84. 'id' => '1',
  85. 'identifier' => 'group_page|node|page|default',
  86. 'group_name' => 'group_page',
  87. 'entity_type' => 'node',
  88. 'bundle' => 'page',
  89. 'mode' => 'default',
  90. 'parent_name' => '',
  91. 'data' => 'a:5:{s:5:"label";s:10:"Node group";s:6:"weight";i:0;s:8:"children";a:0:{}s:11:"format_type";s:5:"htabs";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
  92. ))
  93. ->values(array(
  94. 'id' => '2',
  95. 'identifier' => 'group_user|user|user|default',
  96. 'group_name' => 'group_user',
  97. 'entity_type' => 'user',
  98. 'bundle' => 'user',
  99. 'mode' => 'default',
  100. 'parent_name' => '',
  101. 'data' => 'a:5:{s:5:"label";s:17:"User group parent";s:6:"weight";i:1;s:8:"children";a:0:{}s:11:"format_type";s:3:"div";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
  102. ))
  103. ->values(array(
  104. 'id' => '3',
  105. 'identifier' => 'group_user_child|user|user|default',
  106. 'group_name' => 'group_user_child',
  107. 'entity_type' => 'user',
  108. 'bundle' => 'user',
  109. 'mode' => 'default',
  110. 'parent_name' => 'group_user',
  111. 'data' => 'a:5:{s:5:"label";s:16:"User group child";s:6:"weight";i:99;s:8:"children";a:1:{i:0;s:12:"user_picture";}s:11:"format_type";s:4:"tabs";s:15:"format_settings";a:2:{s:5:"label";s:16:"User group child";s:17:"instance_settings";a:2:{s:7:"classes";s:16:"user-group-child";s:2:"id";s:33:"group_article_node_article_teaser";}}}',
  112. ))
  113. ->values(array(
  114. 'id' => '4',
  115. 'identifier' => 'group_article|node|article|teaser',
  116. 'group_name' => 'group_article',
  117. 'entity_type' => 'node',
  118. 'bundle' => 'article',
  119. 'mode' => 'teaser',
  120. 'parent_name' => '',
  121. 'data' => 'a:5:{s:5:"label";s:10:"htab group";s:6:"weight";i:2;s:8:"children";a:1:{i:0;s:11:"field_image";}s:11:"format_type";s:4:"htab";s:15:"format_settings";a:1:{s:17:"instance_settings";a:1:{s:7:"classes";s:10:"htab-group";}}}',
  122. ))
  123. ->values(array(
  124. 'id' => '5',
  125. 'identifier' => 'group_page|node|page|form',
  126. 'group_name' => 'group_page',
  127. 'entity_type' => 'node',
  128. 'bundle' => 'page',
  129. 'mode' => 'form',
  130. 'parent_name' => '',
  131. 'data' => 'a:5:{s:5:"label";s:15:"Node form group";s:6:"weight";i:0;s:8:"children";a:0:{}s:11:"format_type";s:5:"htabs";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
  132. ))
  133. ->values(array(
  134. 'id' => '6',
  135. 'identifier' => 'group_article|node|article|form',
  136. 'group_name' => 'group_article',
  137. 'entity_type' => 'node',
  138. 'bundle' => 'article',
  139. 'mode' => 'form',
  140. 'parent_name' => '',
  141. 'data' => 'a:5:{s:5:"label";s:15:"htab form group";s:6:"weight";i:2;s:8:"children";a:1:{i:0;s:11:"field_image";}s:11:"format_type";s:4:"htab";s:15:"format_settings";a:1:{s:17:"instance_settings";a:0:{}}}',
  142. ))
  143. ->execute();