3fb3574c1fef035c854d9b788ea64879aa63c6b7
[yaffs-website] / web / modules / contrib / redirect / tests / fixtures / drupal7.php
1 <?php
2 /**
3  * @file
4  * A database agnostic dump for testing purposes.
5  */
6
7 use Drupal\Core\Database\Database;
8
9 $connection = Database::getConnection();
10
11 $connection->schema()->createTable('redirect', array(
12   'fields' => array(
13     'rid' => array(
14       'type' => 'serial',
15       'not null' => TRUE,
16       'size' => 'normal',
17     ),
18     'hash' => array(
19       'type' => 'varchar',
20       'length' => 64,
21       'not null' => TRUE,
22     ),
23     'type' => array(
24       'type' => 'varchar',
25       'length' => 64,
26       'not null' => TRUE,
27     ),
28     'uid' => array(
29       'type' => 'int',
30       'not null' => TRUE,
31     ),
32     'source' => array(
33       'type' => 'varchar',
34       'length' => 255,
35       'not null' => TRUE,
36     ),
37     'source_options' => array(
38       'type' => 'text',
39       'not null' => TRUE,
40     ),
41     'redirect' => array(
42       'type' => 'varchar',
43       'length' => 255,
44       'not null' => TRUE,
45     ),
46     'redirect_options' => array(
47       'type' => 'text',
48       'not null' => TRUE,
49     ),
50     'language' => array(
51       'type' => 'varchar',
52       'length' => 12,
53       'not null' => TRUE,
54       'default' => '',
55     ),
56     'status_code' => array(
57       'type' => 'int',
58       'size' => 'small',
59       'not null' => TRUE,
60     ),
61     'count' => array(
62       'type' => 'int',
63       'not null' => TRUE,
64     ),
65     'access' => array(
66       'type' => 'int',
67       'not null' => TRUE,
68     ),
69   ),
70   'primary key' => array('rid'),
71   'unique keys' => array(
72     'source_language' => array('source', 'language'),
73     'expires' => array('type', 'access')
74   ),
75   'mysql_character_set' => 'utf8',
76 ));
77
78
79 $connection->insert('redirect')
80   ->fields(array(
81     'rid',
82     'hash',
83     'type',
84     'uid',
85     'source',
86     'source_options',
87     'redirect',
88     'redirect_options',
89     'language',
90     'status_code',
91     'count',
92     'access',
93   ))
94   ->values(array(
95     'rid' => 5,
96     'hash' => 'MwmDbnA65ag646gtEdLqmAqTbF0qQerse63RkQmJK_Y',
97     'type' => 'redirect',
98     'uid' => 5,
99     'source' => 'test/source/url',
100     'source_options' => '',
101     'redirect' => 'test/redirect/url',
102     'redirect_options' => '',
103     'language' => 'und',
104     'status_code' => 301,
105     'count' => 2518,
106     'access' => 1449497138,
107   ))
108   ->values(array(
109     'rid' => 7,
110     'hash' => 'GvD5bBB71W8qBvp9I9hHmbSoqZfTvUz0mIkEWjlP8M4',
111     'type' => 'redirect',
112     'uid' => 6,
113     'source' => 'test/source/url2',
114     'source_options' => '',
115     'redirect' => 'http://test/external/redirect/url',
116     'redirect_options' => 'a:1:{s:5:"query";a:2:{s:3:"foo";s:3:"bar";s:3:"biz";s:3:"buz";}}',
117     'language' => 'und',
118     'status_code' => 0,
119     'count' => 419,
120     'access' => 1449497139,
121   ))
122   ->execute();
123
124 $connection->schema()->createTable('variable', array(
125   'fields' => array(
126     'name' => array(
127       'type' => 'varchar',
128       'not null' => TRUE,
129       'length' => '128',
130       'default' => '',
131     ),
132     'value' => array(
133       'type' => 'blob',
134       'not null' => TRUE,
135       'size' => 'normal',
136     ),
137   ),
138   'primary key' => array(
139     'name',
140   ),
141   'mysql_character_set' => 'utf8',
142 ));
143
144 $connection->insert('variable')
145 ->fields(array(
146   'name',
147   'value',
148 ))
149 ->values(array(
150   'name' => 'redirect_default_status_code',
151   'value' => 's:3:"307";',
152 ))
153 ->execute();
154
155 $connection->schema()->createTable('system', array(
156   'fields' => array(
157     'filename' => array(
158       'type' => 'varchar',
159       'not null' => TRUE,
160       'length' => '255',
161       'default' => '',
162     ),
163     'name' => array(
164       'type' => 'varchar',
165       'not null' => TRUE,
166       'length' => '255',
167       'default' => '',
168     ),
169     'type' => array(
170       'type' => 'varchar',
171       'not null' => TRUE,
172       'length' => '12',
173       'default' => '',
174     ),
175     'owner' => array(
176       'type' => 'varchar',
177       'not null' => TRUE,
178       'length' => '255',
179       'default' => '',
180     ),
181     'status' => array(
182       'type' => 'int',
183       'not null' => TRUE,
184       'size' => 'normal',
185       'default' => '0',
186     ),
187     'bootstrap' => array(
188       'type' => 'int',
189       'not null' => TRUE,
190       'size' => 'normal',
191       'default' => '0',
192     ),
193     'schema_version' => array(
194       'type' => 'int',
195       'not null' => TRUE,
196       'size' => 'normal',
197       'default' => '-1',
198     ),
199     'weight' => array(
200       'type' => 'int',
201       'not null' => TRUE,
202       'size' => 'normal',
203       'default' => '0',
204     ),
205     'info' => array(
206       'type' => 'blob',
207       'not null' => FALSE,
208       'size' => 'normal',
209     ),
210   ),
211   'primary key' => array(
212     'filename',
213   ),
214   'mysql_character_set' => 'utf8',
215 ));
216
217 $connection->insert('system')
218 ->fields(array(
219   'filename',
220   'name',
221   'type',
222   'owner',
223   'status',
224   'bootstrap',
225   'schema_version',
226   'weight',
227   'info',
228 ))
229 ->values(array(
230   'filename' => 'modules/contrib/redirect/redirect.module',
231   'name' => 'redirect',
232   'type' => 'module',
233   'owner' => '',
234   'status' => '1',
235   'bootstrap' => '0',
236   'schema_version' => '7000',
237   'weight' => '0',
238   'info' => 'a:13:{s:4:"name";s:8:"Redirect";s:11:"description";s:51:"Allows users to redirect from old URLs to new URLs.";s:4:"core";s:3:"7.x";s:5:"files";a:11:{i:0;s:15:"redirect.module";i:1;s:18:"redirect.admin.inc";i:2;s:16:"redirect.install";i:3;s:13:"redirect.test";i:4;s:24:"views/redirect.views.inc";i:5;s:47:"views/redirect_handler_filter_redirect_type.inc";i:6;s:48:"views/redirect_handler_field_redirect_source.inc";i:7;s:50:"views/redirect_handler_field_redirect_redirect.inc";i:8;s:52:"views/redirect_handler_field_redirect_operations.inc";i:9;s:51:"views/redirect_handler_field_redirect_link_edit.inc";i:10;s:53:"views/redirect_handler_field_redirect_link_delete.inc";}s:9:"configure";s:37:"admin/config/search/redirect/settings";s:7:"version";s:11:"7.x-1.0-rc1";s:7:"project";s:8:"redirect";s:9:"datestamp";s:10:"1347989995";s:5:"mtime";i:1347989995;s:12:"dependencies";a:0:{}s:7:"package";s:5:"Other";s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}',
239 ))
240 ->execute();