Version 1
[yaffs-website] / web / modules / contrib / redirect / tests / fixtures / drupal6.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('path_redirect', array(
12   'fields' => array(
13     'rid' => array(
14       'type' => 'serial',
15       'not null' => TRUE,
16       'size' => 'normal',
17     ),
18     'source' => array(
19       'type' => 'varchar',
20       'length' => 255,
21       'not null' => TRUE,
22     ),
23     'redirect' => array(
24       'type' => 'varchar',
25       'length' => 255,
26       'not null' => TRUE,
27     ),
28     'query' => array(
29       'type' => 'varchar',
30       'length' => 255,
31       'not null' => FALSE,
32     ),
33     'fragment' => array(
34       'type' => 'varchar',
35       'length' => 50,
36       'not null' => FALSE,
37     ),
38     'language' => array(
39       'type' => 'varchar',
40       'length' => 12,
41       'not null' => TRUE,
42       'default' => '',
43     ),
44     'type' => array(
45       'type' => 'int',
46       'size' => 'small',
47       'not null' => TRUE,
48     ),
49     'last_used' => array(
50       'type' => 'int',
51       'unsigned' => TRUE,
52       'not null' => TRUE,
53       'default' => 0,
54     ),
55   ),
56   'primary key' => array('rid'),
57   'unique keys' => array('source_language' => array('source', 'language')),
58   'mysql_character_set' => 'utf8',
59 ));
60
61
62 $connection->insert('path_redirect')
63   ->fields(array(
64     'rid',
65     'source',
66     'redirect',
67     'query',
68     'fragment',
69     'language',
70     'type',
71     'last_used',
72   ))
73   ->values(array(
74     'rid' => 5,
75     'source' => 'test/source/url',
76     'redirect' => 'test/redirect/url',
77     'query' => NULL,
78     'fragment' => NULL,
79     'language' => '',
80     'type' => 301,
81     'last_used' => 1449497138,
82   ))
83   ->values(array(
84     'rid' => 7,
85     'source' => 'test/source/url2',
86     'redirect' => 'http://test/external/redirect/url',
87     'query' => 'foo=bar&biz=buz',
88     'fragment' => NULL,
89     'language' => 'en',
90     'type' => 302,
91     'last_used' => 1449497139,
92   ))
93   ->execute();