@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array( |
4 | - 'name' => 'ai-ezpublish', |
|
5 | - 'depends' => array( |
|
6 | - 'aimeos-core', |
|
7 | - ), |
|
8 | - 'include' => array( |
|
9 | - 'lib/custom/src', |
|
10 | - ), |
|
11 | - 'config' => array( |
|
12 | - 'lib/custom/config', |
|
13 | - ), |
|
14 | - 'setup' => array( |
|
15 | - 'lib/custom/setup', |
|
16 | - ), |
|
4 | + 'name' => 'ai-ezpublish', |
|
5 | + 'depends' => array( |
|
6 | + 'aimeos-core', |
|
7 | + ), |
|
8 | + 'include' => array( |
|
9 | + 'lib/custom/src', |
|
10 | + ), |
|
11 | + 'config' => array( |
|
12 | + 'lib/custom/config', |
|
13 | + ), |
|
14 | + 'setup' => array( |
|
15 | + 'lib/custom/setup', |
|
16 | + ), |
|
17 | 17 | ); |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array( |
9 | - 'delete' => array( |
|
10 | - 'ansi' => ' |
|
9 | + 'delete' => array( |
|
10 | + 'ansi' => ' |
|
11 | 11 | DELETE FROM "ezuser_address" |
12 | 12 | WHERE :cond |
13 | 13 | ', |
14 | - ), |
|
15 | - 'insert' => array( |
|
16 | - 'ansi' => ' |
|
14 | + ), |
|
15 | + 'insert' => array( |
|
16 | + 'ansi' => ' |
|
17 | 17 | INSERT INTO "ezuser_address" ( |
18 | 18 | "siteid", "parentid", "company", "vatid", "salutation", "title", |
19 | 19 | "firstname", "lastname", "address1", "address2", "address3", |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? |
25 | 25 | ) |
26 | 26 | ', |
27 | - ), |
|
28 | - 'update' => array( |
|
29 | - 'ansi' => ' |
|
27 | + ), |
|
28 | + 'update' => array( |
|
29 | + 'ansi' => ' |
|
30 | 30 | UPDATE "ezuser_address" |
31 | 31 | SET "siteid" = ?, "parentid" = ?, "company" = ?, "vatid" = ?, "salutation" = ?, |
32 | 32 | "title" = ?, "firstname" = ?, "lastname" = ?, "address1" = ?, |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | "pos" = ?, "mtime" = ?, "editor" = ? |
37 | 37 | WHERE "id" = ? |
38 | 38 | ', |
39 | - ), |
|
40 | - 'search' => array( |
|
41 | - 'ansi' => ' |
|
39 | + ), |
|
40 | + 'search' => array( |
|
41 | + 'ansi' => ' |
|
42 | 42 | SELECT DISTINCT ezuad."id" AS "customer.address.id", ezuad."parentid" AS "customer.address.parentid", |
43 | 43 | ezuad."company" AS "customer.address.company", ezuad."vatid" AS "customer.address.vatid", |
44 | 44 | ezuad."salutation" AS "customer.address.salutation", ezuad."title" AS "customer.address.title", |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | /*-orderby*/ ORDER BY :order /*orderby-*/ |
59 | 59 | LIMIT :size OFFSET :start |
60 | 60 | ', |
61 | - ), |
|
62 | - 'count' => array( |
|
63 | - 'ansi' => ' |
|
61 | + ), |
|
62 | + 'count' => array( |
|
63 | + 'ansi' => ' |
|
64 | 64 | SELECT COUNT(*) AS "count" |
65 | 65 | FROM ( |
66 | 66 | SELECT DISTINCT ezuad."id" |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | LIMIT 10000 OFFSET 0 |
71 | 71 | ) AS list |
72 | 72 | ', |
73 | - ), |
|
74 | - 'newid' => array( |
|
75 | - 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
76 | - 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
77 | - 'oracle' => 'SELECT ezuser_address.CURRVAL FROM DUAL', |
|
78 | - 'pgsql' => 'SELECT lastval()', |
|
79 | - 'sqlite' => 'SELECT last_insert_rowid()', |
|
80 | - 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
81 | - 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
82 | - ), |
|
73 | + ), |
|
74 | + 'newid' => array( |
|
75 | + 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
76 | + 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
77 | + 'oracle' => 'SELECT ezuser_address.CURRVAL FROM DUAL', |
|
78 | + 'pgsql' => 'SELECT lastval()', |
|
79 | + 'sqlite' => 'SELECT last_insert_rowid()', |
|
80 | + 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
81 | + 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
82 | + ), |
|
83 | 83 | ); |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array( |
9 | - 'aggregate' => array( |
|
10 | - 'ansi' => ' |
|
9 | + 'aggregate' => array( |
|
10 | + 'ansi' => ' |
|
11 | 11 | SELECT "key", COUNT(DISTINCT "id") AS "count" |
12 | 12 | FROM ( |
13 | 13 | SELECT :key AS "key", ezuli."id" AS "id" |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | ) AS list |
20 | 20 | GROUP BY "key" |
21 | 21 | ', |
22 | - ), |
|
23 | - 'getposmax' => array( |
|
24 | - 'ansi' => ' |
|
22 | + ), |
|
23 | + 'getposmax' => array( |
|
24 | + 'ansi' => ' |
|
25 | 25 | SELECT MAX( "pos" ) AS pos |
26 | 26 | FROM "ezuser_list" |
27 | 27 | WHERE "siteid" = ? |
@@ -29,37 +29,37 @@ discard block |
||
29 | 29 | AND "typeid" = ? |
30 | 30 | AND "domain" = ? |
31 | 31 | ', |
32 | - ), |
|
33 | - 'insert' => array( |
|
34 | - 'ansi' => ' |
|
32 | + ), |
|
33 | + 'insert' => array( |
|
34 | + 'ansi' => ' |
|
35 | 35 | INSERT INTO "ezuser_list"( "parentid", "siteid", "typeid", "domain", "refid", "start", "end", |
36 | 36 | "config", "pos", "status", "mtime", "editor", "ctime" ) |
37 | 37 | VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) |
38 | 38 | ', |
39 | - ), |
|
40 | - 'update' => array( |
|
41 | - 'ansi' => ' |
|
39 | + ), |
|
40 | + 'update' => array( |
|
41 | + 'ansi' => ' |
|
42 | 42 | UPDATE "ezuser_list" |
43 | 43 | SET "parentid"=?, "siteid" = ?, "typeid" = ?, "domain" = ?, "refid" = ?, "start" = ?, "end" = ?, |
44 | 44 | "config" = ?, "pos" = ?, "status" = ?, "mtime" = ?, "editor" = ? |
45 | 45 | WHERE "id" = ? |
46 | 46 | ', |
47 | - ), |
|
48 | - 'updatepos' => array( |
|
49 | - 'ansi' => ' |
|
47 | + ), |
|
48 | + 'updatepos' => array( |
|
49 | + 'ansi' => ' |
|
50 | 50 | UPDATE "ezuser_list" |
51 | 51 | SET "pos" = ?, "mtime" = ?, "editor" = ? |
52 | 52 | WHERE "id" = ? |
53 | 53 | ', |
54 | - ), |
|
55 | - 'delete' => array( |
|
56 | - 'ansi' => ' |
|
54 | + ), |
|
55 | + 'delete' => array( |
|
56 | + 'ansi' => ' |
|
57 | 57 | DELETE FROM "ezuser_list" |
58 | 58 | WHERE :cond AND siteid = ? |
59 | 59 | ', |
60 | - ), |
|
61 | - 'move' => array( |
|
62 | - 'ansi' => ' |
|
60 | + ), |
|
61 | + 'move' => array( |
|
62 | + 'ansi' => ' |
|
63 | 63 | UPDATE "ezuser_list" |
64 | 64 | SET "pos" = "pos" + ?, "mtime" = ?, "editor" = ? |
65 | 65 | WHERE "siteid" = ? |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | AND "domain" = ? |
69 | 69 | AND "pos" >= ? |
70 | 70 | ', |
71 | - ), |
|
72 | - 'search' => array( |
|
73 | - 'ansi' => ' |
|
71 | + ), |
|
72 | + 'search' => array( |
|
73 | + 'ansi' => ' |
|
74 | 74 | SELECT ezuli."id" AS "customer.lists.id", ezuli."siteid" AS "customer.lists.siteid", |
75 | 75 | ezuli."parentid" AS "customer.lists.parentid", ezuli."typeid" AS "customer.lists.typeid", |
76 | 76 | ezuli."domain" AS "customer.lists.domain", ezuli."refid" AS "customer.lists.refid", |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | /*-orderby*/ ORDER BY :order /*orderby-*/ |
85 | 85 | LIMIT :size OFFSET :start |
86 | 86 | ', |
87 | - ), |
|
88 | - 'count' => array( |
|
89 | - 'ansi' => ' |
|
87 | + ), |
|
88 | + 'count' => array( |
|
89 | + 'ansi' => ' |
|
90 | 90 | SELECT COUNT(*) AS "count" |
91 | 91 | FROM ( |
92 | 92 | SELECT DISTINCT ezuli."id" |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | LIMIT 10000 OFFSET 0 |
97 | 97 | ) AS list |
98 | 98 | ', |
99 | - ), |
|
100 | - 'newid' => array( |
|
101 | - 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
102 | - 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
103 | - 'oracle' => 'SELECT ezuser_list.CURRVAL FROM DUAL', |
|
104 | - 'pgsql' => 'SELECT lastval()', |
|
105 | - 'sqlite' => 'SELECT last_insert_rowid()', |
|
106 | - 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
107 | - 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
108 | - ), |
|
99 | + ), |
|
100 | + 'newid' => array( |
|
101 | + 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
102 | + 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
103 | + 'oracle' => 'SELECT ezuser_list.CURRVAL FROM DUAL', |
|
104 | + 'pgsql' => 'SELECT lastval()', |
|
105 | + 'sqlite' => 'SELECT last_insert_rowid()', |
|
106 | + 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
107 | + 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
108 | + ), |
|
109 | 109 | ); |
@@ -6,28 +6,28 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array( |
9 | - 'insert' => array( |
|
10 | - 'ansi' => ' |
|
9 | + 'insert' => array( |
|
10 | + 'ansi' => ' |
|
11 | 11 | INSERT INTO "ezuser_list_type"( "siteid", "code", "domain", "label", "status", |
12 | 12 | "mtime", "editor", "ctime" ) |
13 | 13 | VALUES ( ?, ?, ?, ?, ?, ?, ?, ? ) |
14 | 14 | ', |
15 | - ), |
|
16 | - 'update' => array( |
|
17 | - 'ansi' => ' |
|
15 | + ), |
|
16 | + 'update' => array( |
|
17 | + 'ansi' => ' |
|
18 | 18 | UPDATE "ezuser_list_type" |
19 | 19 | SET "siteid"=?, "code" = ?, "domain" = ?, "label" = ?, "status" = ?, "mtime" = ?, "editor" = ? |
20 | 20 | WHERE "id" = ? |
21 | 21 | ', |
22 | - ), |
|
23 | - 'delete' => array( |
|
24 | - 'ansi' => ' |
|
22 | + ), |
|
23 | + 'delete' => array( |
|
24 | + 'ansi' => ' |
|
25 | 25 | DELETE FROM "ezuser_list_type" |
26 | 26 | WHERE :cond AND siteid = ? |
27 | 27 | ', |
28 | - ), |
|
29 | - 'search' => array( |
|
30 | - 'ansi' => ' |
|
28 | + ), |
|
29 | + 'search' => array( |
|
30 | + 'ansi' => ' |
|
31 | 31 | SELECT ezulity."id" AS "customer.lists.type.id", ezulity."siteid" AS "customer.lists.type.siteid", |
32 | 32 | ezulity."code" AS "customer.lists.type.code", ezulity."domain" AS "customer.lists.type.domain", |
33 | 33 | ezulity."label" AS "customer.lists.type.label", ezulity."status" AS "customer.lists.type.status", |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | /*-orderby*/ ORDER BY :order /*orderby-*/ |
41 | 41 | LIMIT :size OFFSET :start |
42 | 42 | ', |
43 | - ), |
|
44 | - 'count' => array( |
|
45 | - 'ansi' => ' |
|
43 | + ), |
|
44 | + 'count' => array( |
|
45 | + 'ansi' => ' |
|
46 | 46 | SELECT COUNT(*) AS "count" |
47 | 47 | FROM ( |
48 | 48 | SELECT DISTINCT ezulity."id" |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | LIMIT 10000 OFFSET 0 |
53 | 53 | ) AS LIST |
54 | 54 | ', |
55 | - ), |
|
56 | - 'newid' => array( |
|
57 | - 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
58 | - 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
59 | - 'oracle' => 'SELECT ezuser_list_type.CURRVAL FROM DUAL', |
|
60 | - 'pgsql' => 'SELECT lastval()', |
|
61 | - 'sqlite' => 'SELECT last_insert_rowid()', |
|
62 | - 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
63 | - 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
64 | - ), |
|
55 | + ), |
|
56 | + 'newid' => array( |
|
57 | + 'db2' => 'SELECT IDENTITY_VAL_LOCAL()', |
|
58 | + 'mysql' => 'SELECT LAST_INSERT_ID()', |
|
59 | + 'oracle' => 'SELECT ezuser_list_type.CURRVAL FROM DUAL', |
|
60 | + 'pgsql' => 'SELECT lastval()', |
|
61 | + 'sqlite' => 'SELECT last_insert_rowid()', |
|
62 | + 'sqlsrv' => 'SELECT SCOPE_IDENTITY()', |
|
63 | + 'sqlanywhere' => 'SELECT @@IDENTITY', |
|
64 | + ), |
|
65 | 65 | ); |
@@ -4,17 +4,17 @@ |
||
4 | 4 | * Set error reporting to maximum |
5 | 5 | */ |
6 | 6 | error_reporting( -1 ); |
7 | -ini_set( 'display_errors', true ); |
|
7 | +ini_set('display_errors', true); |
|
8 | 8 | |
9 | -date_default_timezone_set( 'UTC' ); |
|
9 | +date_default_timezone_set('UTC'); |
|
10 | 10 | |
11 | 11 | /* |
12 | 12 | * Set locale settings to reasonable defaults |
13 | 13 | */ |
14 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
15 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
16 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
17 | -setlocale( LC_TIME, 'POSIX' ); |
|
14 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
15 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
16 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
17 | +setlocale(LC_TIME, 'POSIX'); |
|
18 | 18 | |
19 | 19 | |
20 | 20 | require_once 'TestHelper.php'; |
@@ -50,8 +50,7 @@ |
||
50 | 50 | { |
51 | 51 | $this->executeList( $sql, 'db-customer' ); |
52 | 52 | $this->status( 'done' ); |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | $this->status( 'OK' ); |
57 | 56 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPreDependencies() |
23 | 23 | { |
24 | - return array( 'TablesCreateEzpublish' ); |
|
24 | + return array('TablesCreateEzpublish'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function migrate() |
32 | 32 | { |
33 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
33 | + $this->msg('Adding address fields to ezuser table', 0); |
|
34 | 34 | |
35 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
35 | + $dbal = $this->getConnection('db-customer')->getRawObject(); |
|
36 | 36 | |
37 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
38 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
37 | + if (!($dbal instanceof \Doctrine\DBAL\Connection)) { |
|
38 | + throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $comparator = new \Doctrine\DBAL\Schema\Comparator(); |
44 | 44 | $toSchema = clone $fromSchema; |
45 | 45 | |
46 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
47 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
46 | + $this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); |
|
47 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); |
|
48 | 48 | |
49 | - if( $sql !== array() ) |
|
49 | + if ($sql !== array()) |
|
50 | 50 | { |
51 | - $this->executeList( $sql, 'db-customer' ); |
|
52 | - $this->status( 'done' ); |
|
51 | + $this->executeList($sql, 'db-customer'); |
|
52 | + $this->status('done'); |
|
53 | 53 | } |
54 | 54 | else |
55 | 55 | { |
56 | - $this->status( 'OK' ); |
|
56 | + $this->status('OK'); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -64,38 +64,38 @@ discard block |
||
64 | 64 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
65 | 65 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
66 | 66 | */ |
67 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
67 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) |
|
68 | 68 | { |
69 | 69 | $columns = array( |
70 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
71 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
72 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
73 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
74 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
75 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
76 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
77 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
78 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
79 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
80 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
81 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
82 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
83 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
84 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
85 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
86 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
87 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
88 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
89 | - 'status' => array( 'smallint', array() ), |
|
90 | - 'mtime' => array( 'datetime', array() ), |
|
91 | - 'ctime' => array( 'datetime', array() ), |
|
92 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
70 | + 'company' => array('string', array('length' => 100)), |
|
71 | + 'vatid' => array('string', array('length' => 32)), |
|
72 | + 'salutation' => array('string', array('length' => 8)), |
|
73 | + 'title' => array('string', array('length' => 64)), |
|
74 | + 'firstname' => array('string', array('length' => 64)), |
|
75 | + 'lastname' => array('string', array('length' => 64)), |
|
76 | + 'address1' => array('string', array('length' => 255)), |
|
77 | + 'address2' => array('string', array('length' => 255)), |
|
78 | + 'address3' => array('string', array('length' => 255)), |
|
79 | + 'postal' => array('string', array('length' => 16)), |
|
80 | + 'city' => array('string', array('length' => 255)), |
|
81 | + 'state' => array('string', array('length' => 255)), |
|
82 | + 'langid' => array('string', array('length' => 5, 'notnull' => false)), |
|
83 | + 'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), |
|
84 | + 'telephone' => array('string', array('length' => 32)), |
|
85 | + 'telefax' => array('string', array('length' => 32)), |
|
86 | + 'website' => array('string', array('length' => 255)), |
|
87 | + 'birthday' => array('date', array('notnull' => false)), |
|
88 | + 'vdate' => array('date', array('notnull' => false)), |
|
89 | + 'status' => array('smallint', array()), |
|
90 | + 'mtime' => array('datetime', array()), |
|
91 | + 'ctime' => array('datetime', array()), |
|
92 | + 'editor' => array('string', array('length' => 255)), |
|
93 | 93 | ); |
94 | 94 | |
95 | - foreach( $columns as $name => $def ) |
|
95 | + foreach ($columns as $name => $def) |
|
96 | 96 | { |
97 | - if( $table->hasColumn( $name ) === false ) { |
|
98 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
97 | + if ($table->hasColumn($name) === false) { |
|
98 | + $table->addColumn($name, $def[0], $def[1]); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -109,23 +109,23 @@ discard block |
||
109 | 109 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
110 | 110 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
111 | 111 | */ |
112 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
112 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) |
|
113 | 113 | { |
114 | 114 | $indexes = array( |
115 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
116 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
117 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
118 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
119 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
120 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
121 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
122 | - 'idx_ezpus_city' => array( 'city' ), |
|
115 | + 'idx_ezpus_langid' => array('langid'), |
|
116 | + 'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), |
|
117 | + 'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), |
|
118 | + 'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), |
|
119 | + 'idx_ezpus_lastname' => array('lastname'), |
|
120 | + 'idx_ezpus_address1' => array('address1'), |
|
121 | + 'idx_ezpus_postal' => array('postal'), |
|
122 | + 'idx_ezpus_city' => array('city'), |
|
123 | 123 | ); |
124 | 124 | |
125 | - foreach( $indexes as $name => $def ) |
|
125 | + foreach ($indexes as $name => $def) |
|
126 | 126 | { |
127 | - if( $table->hasIndex( $name ) === false ) { |
|
128 | - $table->addIndex( $def, $name ); |
|
127 | + if ($table->hasIndex($name) === false) { |
|
128 | + $table->addIndex($def, $name); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 |
@@ -14,120 +14,120 @@ |
||
14 | 14 | */ |
15 | 15 | class EzuserAddAddress extends \Aimeos\MW\Setup\Task\TablesCreateMShop |
16 | 16 | { |
17 | - /** |
|
18 | - * Returns the list of task names which depends on this task. |
|
19 | - * |
|
20 | - * @return array List of task names |
|
21 | - */ |
|
22 | - public function getPreDependencies() |
|
23 | - { |
|
24 | - return array( 'TablesCreateEzpublish' ); |
|
25 | - } |
|
26 | - |
|
27 | - |
|
28 | - /** |
|
29 | - * Migrate database schema |
|
30 | - */ |
|
31 | - public function migrate() |
|
32 | - { |
|
33 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
34 | - |
|
35 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
36 | - |
|
37 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
38 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
39 | - } |
|
40 | - |
|
41 | - |
|
42 | - $fromSchema = $dbal->getSchemaManager()->createSchema(); |
|
43 | - $toSchema = clone $fromSchema; |
|
44 | - |
|
45 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
46 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
47 | - |
|
48 | - if( $sql !== array() ) |
|
49 | - { |
|
50 | - $this->executeList( $sql, 'db-customer' ); |
|
51 | - $this->status( 'done' ); |
|
52 | - } |
|
53 | - else |
|
54 | - { |
|
55 | - $this->status( 'OK' ); |
|
56 | - } |
|
57 | - } |
|
58 | - |
|
59 | - |
|
60 | - /** |
|
61 | - * Adds the missing columns to the table |
|
62 | - * |
|
63 | - * @param \Doctrine\DBAL\Schema\Table $table Table object |
|
64 | - * @return \Doctrine\DBAL\Schema\Table Updated table object |
|
65 | - */ |
|
66 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
67 | - { |
|
68 | - $columns = array( |
|
69 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
70 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
71 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
72 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
73 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
74 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
75 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
76 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
77 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
78 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
79 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
80 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
81 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
82 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
83 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
84 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
85 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
86 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
87 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
88 | - 'status' => array( 'smallint', array() ), |
|
89 | - 'mtime' => array( 'datetime', array() ), |
|
90 | - 'ctime' => array( 'datetime', array() ), |
|
91 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
92 | - ); |
|
93 | - |
|
94 | - foreach( $columns as $name => $def ) |
|
95 | - { |
|
96 | - if( $table->hasColumn( $name ) === false ) { |
|
97 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
98 | - } |
|
99 | - } |
|
100 | - |
|
101 | - return $table; |
|
102 | - } |
|
103 | - |
|
104 | - |
|
105 | - /** |
|
106 | - * Adds the missing indexes to the table |
|
107 | - * |
|
108 | - * @param \Doctrine\DBAL\Schema\Table $table Table object |
|
109 | - * @return \Doctrine\DBAL\Schema\Table Updated table object |
|
110 | - */ |
|
111 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
112 | - { |
|
113 | - $indexes = array( |
|
114 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
115 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
116 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
117 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
118 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
119 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
120 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
121 | - 'idx_ezpus_city' => array( 'city' ), |
|
122 | - ); |
|
123 | - |
|
124 | - foreach( $indexes as $name => $def ) |
|
125 | - { |
|
126 | - if( $table->hasIndex( $name ) === false ) { |
|
127 | - $table->addIndex( $def, $name ); |
|
128 | - } |
|
129 | - } |
|
130 | - |
|
131 | - return $table; |
|
132 | - } |
|
17 | + /** |
|
18 | + * Returns the list of task names which depends on this task. |
|
19 | + * |
|
20 | + * @return array List of task names |
|
21 | + */ |
|
22 | + public function getPreDependencies() |
|
23 | + { |
|
24 | + return array( 'TablesCreateEzpublish' ); |
|
25 | + } |
|
26 | + |
|
27 | + |
|
28 | + /** |
|
29 | + * Migrate database schema |
|
30 | + */ |
|
31 | + public function migrate() |
|
32 | + { |
|
33 | + $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
34 | + |
|
35 | + $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
36 | + |
|
37 | + if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
38 | + throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
39 | + } |
|
40 | + |
|
41 | + |
|
42 | + $fromSchema = $dbal->getSchemaManager()->createSchema(); |
|
43 | + $toSchema = clone $fromSchema; |
|
44 | + |
|
45 | + $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
46 | + $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
47 | + |
|
48 | + if( $sql !== array() ) |
|
49 | + { |
|
50 | + $this->executeList( $sql, 'db-customer' ); |
|
51 | + $this->status( 'done' ); |
|
52 | + } |
|
53 | + else |
|
54 | + { |
|
55 | + $this->status( 'OK' ); |
|
56 | + } |
|
57 | + } |
|
58 | + |
|
59 | + |
|
60 | + /** |
|
61 | + * Adds the missing columns to the table |
|
62 | + * |
|
63 | + * @param \Doctrine\DBAL\Schema\Table $table Table object |
|
64 | + * @return \Doctrine\DBAL\Schema\Table Updated table object |
|
65 | + */ |
|
66 | + protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
67 | + { |
|
68 | + $columns = array( |
|
69 | + 'company' => array( 'string', array( 'length' => 100 ) ), |
|
70 | + 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
71 | + 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
72 | + 'title' => array( 'string', array( 'length' => 64 ) ), |
|
73 | + 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
74 | + 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
75 | + 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
76 | + 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
77 | + 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
78 | + 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
79 | + 'city' => array( 'string', array( 'length' => 255 ) ), |
|
80 | + 'state' => array( 'string', array( 'length' => 255 ) ), |
|
81 | + 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
82 | + 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
83 | + 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
84 | + 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
85 | + 'website' => array( 'string', array( 'length' => 255 ) ), |
|
86 | + 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
87 | + 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
88 | + 'status' => array( 'smallint', array() ), |
|
89 | + 'mtime' => array( 'datetime', array() ), |
|
90 | + 'ctime' => array( 'datetime', array() ), |
|
91 | + 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
92 | + ); |
|
93 | + |
|
94 | + foreach( $columns as $name => $def ) |
|
95 | + { |
|
96 | + if( $table->hasColumn( $name ) === false ) { |
|
97 | + $table->addColumn( $name, $def[0], $def[1] ); |
|
98 | + } |
|
99 | + } |
|
100 | + |
|
101 | + return $table; |
|
102 | + } |
|
103 | + |
|
104 | + |
|
105 | + /** |
|
106 | + * Adds the missing indexes to the table |
|
107 | + * |
|
108 | + * @param \Doctrine\DBAL\Schema\Table $table Table object |
|
109 | + * @return \Doctrine\DBAL\Schema\Table Updated table object |
|
110 | + */ |
|
111 | + protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
112 | + { |
|
113 | + $indexes = array( |
|
114 | + 'idx_ezpus_langid' => array( 'langid' ), |
|
115 | + 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
116 | + 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
117 | + 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
118 | + 'idx_ezpus_lastname' => array( 'lastname' ), |
|
119 | + 'idx_ezpus_address1' => array( 'address1' ), |
|
120 | + 'idx_ezpus_postal' => array( 'postal' ), |
|
121 | + 'idx_ezpus_city' => array( 'city' ), |
|
122 | + ); |
|
123 | + |
|
124 | + foreach( $indexes as $name => $def ) |
|
125 | + { |
|
126 | + if( $table->hasIndex( $name ) === false ) { |
|
127 | + $table->addIndex( $def, $name ); |
|
128 | + } |
|
129 | + } |
|
130 | + |
|
131 | + return $table; |
|
132 | + } |
|
133 | 133 | } |
@@ -7,125 +7,125 @@ |
||
7 | 7 | |
8 | 8 | |
9 | 9 | return array( |
10 | - 'table' => array( |
|
11 | - 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | - |
|
13 | - $table = $schema->createTable( 'ezuser' ); |
|
14 | - |
|
15 | - $table->addColumn( 'contentobject_id', 'integer', array() ); |
|
16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
21 | - |
|
22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
24 | - |
|
25 | - return $schema; |
|
26 | - }, |
|
27 | - |
|
28 | - 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
29 | - |
|
30 | - $table = $schema->createTable( 'ezuser_address' ); |
|
31 | - |
|
32 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
33 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
34 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
35 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
36 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
37 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
38 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
39 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
40 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
41 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
42 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
43 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
44 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
45 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
46 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
47 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
48 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
49 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
50 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
51 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
52 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
53 | - $table->addColumn( 'flag', 'integer', array() ); |
|
54 | - $table->addColumn( 'pos', 'smallint', array() ); |
|
55 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
56 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
57 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
58 | - |
|
59 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
60 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
61 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
62 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
63 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
64 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
65 | - |
|
66 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
67 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
68 | - |
|
69 | - return $schema; |
|
70 | - }, |
|
71 | - |
|
72 | - 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
73 | - |
|
74 | - $table = $schema->createTable( 'ezuser_list_type' ); |
|
75 | - |
|
76 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
77 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
78 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
79 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
81 | - $table->addColumn( 'status', 'smallint', array() ); |
|
82 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
83 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
84 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
85 | - |
|
86 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
87 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
88 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
89 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
90 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
91 | - |
|
92 | - return $schema; |
|
93 | - }, |
|
94 | - |
|
95 | - 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
96 | - |
|
97 | - $table = $schema->createTable( 'ezuser_list' ); |
|
98 | - |
|
99 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
100 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
101 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
102 | - $table->addColumn( 'typeid', 'integer', array() ); |
|
103 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
104 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
105 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
106 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
107 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
108 | - $table->addColumn( 'pos', 'integer', array() ); |
|
109 | - $table->addColumn( 'status', 'smallint', array() ); |
|
110 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
111 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
112 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
113 | - |
|
114 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
115 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
116 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
117 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
118 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
119 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
120 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
121 | - |
|
122 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
123 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
124 | - |
|
125 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
126 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
127 | - |
|
128 | - return $schema; |
|
129 | - }, |
|
130 | - ), |
|
10 | + 'table' => array( |
|
11 | + 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | + |
|
13 | + $table = $schema->createTable( 'ezuser' ); |
|
14 | + |
|
15 | + $table->addColumn( 'contentobject_id', 'integer', array() ); |
|
16 | + $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | + $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | + $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | + $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | + $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
21 | + |
|
22 | + $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | + $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
24 | + |
|
25 | + return $schema; |
|
26 | + }, |
|
27 | + |
|
28 | + 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
29 | + |
|
30 | + $table = $schema->createTable( 'ezuser_address' ); |
|
31 | + |
|
32 | + $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
33 | + $table->addColumn( 'siteid', 'integer', array() ); |
|
34 | + $table->addColumn( 'parentid', 'integer', array() ); |
|
35 | + $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
36 | + $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
37 | + $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
38 | + $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
39 | + $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
40 | + $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
41 | + $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
42 | + $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
43 | + $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
44 | + $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
45 | + $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
46 | + $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
47 | + $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
48 | + $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
49 | + $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
50 | + $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
51 | + $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
52 | + $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
53 | + $table->addColumn( 'flag', 'integer', array() ); |
|
54 | + $table->addColumn( 'pos', 'smallint', array() ); |
|
55 | + $table->addColumn( 'mtime', 'datetime', array() ); |
|
56 | + $table->addColumn( 'ctime', 'datetime', array() ); |
|
57 | + $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
58 | + |
|
59 | + $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
60 | + $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
61 | + $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
62 | + $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
63 | + $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
64 | + $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
65 | + |
|
66 | + $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
67 | + array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
68 | + |
|
69 | + return $schema; |
|
70 | + }, |
|
71 | + |
|
72 | + 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
73 | + |
|
74 | + $table = $schema->createTable( 'ezuser_list_type' ); |
|
75 | + |
|
76 | + $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
77 | + $table->addColumn( 'siteid', 'integer', array() ); |
|
78 | + $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
79 | + $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
80 | + $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
81 | + $table->addColumn( 'status', 'smallint', array() ); |
|
82 | + $table->addColumn( 'mtime', 'datetime', array() ); |
|
83 | + $table->addColumn( 'ctime', 'datetime', array() ); |
|
84 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
85 | + |
|
86 | + $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
87 | + $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
88 | + $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
89 | + $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
90 | + $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
91 | + |
|
92 | + return $schema; |
|
93 | + }, |
|
94 | + |
|
95 | + 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
96 | + |
|
97 | + $table = $schema->createTable( 'ezuser_list' ); |
|
98 | + |
|
99 | + $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
100 | + $table->addColumn( 'parentid', 'integer', array() ); |
|
101 | + $table->addColumn( 'siteid', 'integer', array() ); |
|
102 | + $table->addColumn( 'typeid', 'integer', array() ); |
|
103 | + $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
104 | + $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
105 | + $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
106 | + $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
107 | + $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
108 | + $table->addColumn( 'pos', 'integer', array() ); |
|
109 | + $table->addColumn( 'status', 'smallint', array() ); |
|
110 | + $table->addColumn( 'mtime', 'datetime', array() ); |
|
111 | + $table->addColumn( 'ctime', 'datetime', array() ); |
|
112 | + $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
113 | + |
|
114 | + $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
115 | + $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
116 | + $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
117 | + $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
118 | + $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
119 | + $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
120 | + $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
121 | + |
|
122 | + $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
123 | + array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
124 | + |
|
125 | + $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
126 | + array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
127 | + |
|
128 | + return $schema; |
|
129 | + }, |
|
130 | + ), |
|
131 | 131 | ); |
@@ -8,122 +8,122 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | 12 | |
13 | - $table = $schema->createTable( 'ezuser' ); |
|
13 | + $table = $schema->createTable('ezuser'); |
|
14 | 14 | |
15 | - $table->addColumn( 'contentobject_id', 'integer', array() ); |
|
16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
15 | + $table->addColumn('contentobject_id', 'integer', array()); |
|
16 | + $table->addColumn('email', 'string', array('length' => 150)); |
|
17 | + $table->addColumn('login', 'string', array('length' => 150)); |
|
18 | + $table->addColumn('login_normalized', 'string', array('length' => 150)); |
|
19 | + $table->addColumn('password_hash', 'string', array('length' => 50)); |
|
20 | + $table->addColumn('password_hash_type', 'integer', array('default' => 1)); |
|
21 | 21 | |
22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
22 | + $table->setPrimaryKey(array('contentobject_id')); |
|
23 | + $table->addUniqueIndex(array('login_normalized'), 'ezuser_login'); |
|
24 | 24 | |
25 | 25 | return $schema; |
26 | 26 | }, |
27 | 27 | |
28 | - 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
29 | - |
|
30 | - $table = $schema->createTable( 'ezuser_address' ); |
|
31 | - |
|
32 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
33 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
34 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
35 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
36 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
37 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
38 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
39 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
40 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
41 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
42 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
43 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
44 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
45 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
46 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
47 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
48 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
49 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
50 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
51 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
52 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
53 | - $table->addColumn( 'flag', 'integer', array() ); |
|
54 | - $table->addColumn( 'pos', 'smallint', array() ); |
|
55 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
56 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
57 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
58 | - |
|
59 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
60 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
61 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
62 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
63 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
64 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
65 | - |
|
66 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
67 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
28 | + 'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
29 | + |
|
30 | + $table = $schema->createTable('ezuser_address'); |
|
31 | + |
|
32 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
33 | + $table->addColumn('siteid', 'integer', array()); |
|
34 | + $table->addColumn('parentid', 'integer', array()); |
|
35 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
36 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
37 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
38 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
39 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
40 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
41 | + $table->addColumn('address1', 'string', array('length' => 255)); |
|
42 | + $table->addColumn('address2', 'string', array('length' => 255)); |
|
43 | + $table->addColumn('address3', 'string', array('length' => 255)); |
|
44 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
45 | + $table->addColumn('city', 'string', array('length' => 255)); |
|
46 | + $table->addColumn('state', 'string', array('length' => 255)); |
|
47 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
48 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
49 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
50 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
51 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
52 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
53 | + $table->addColumn('flag', 'integer', array()); |
|
54 | + $table->addColumn('pos', 'smallint', array()); |
|
55 | + $table->addColumn('mtime', 'datetime', array()); |
|
56 | + $table->addColumn('ctime', 'datetime', array()); |
|
57 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
58 | + |
|
59 | + $table->setPrimaryKey(array('id'), 'pk_ezpad_id'); |
|
60 | + $table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn'); |
|
61 | + $table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2'); |
|
62 | + $table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci'); |
|
63 | + $table->addIndex(array('parentid'), 'idx_ezpad_pid'); |
|
64 | + $table->addIndex(array('city'), 'idx_ezpad_city'); |
|
65 | + |
|
66 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
67 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid'); |
|
68 | 68 | |
69 | 69 | return $schema; |
70 | 70 | }, |
71 | 71 | |
72 | - 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
72 | + 'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
73 | 73 | |
74 | - $table = $schema->createTable( 'ezuser_list_type' ); |
|
74 | + $table = $schema->createTable('ezuser_list_type'); |
|
75 | 75 | |
76 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
77 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
78 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
79 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
81 | - $table->addColumn( 'status', 'smallint', array() ); |
|
82 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
83 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
84 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
76 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
77 | + $table->addColumn('siteid', 'integer', array()); |
|
78 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
79 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
80 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
81 | + $table->addColumn('status', 'smallint', array()); |
|
82 | + $table->addColumn('mtime', 'datetime', array()); |
|
83 | + $table->addColumn('ctime', 'datetime', array()); |
|
84 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
85 | 85 | |
86 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
87 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
88 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
89 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
90 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
86 | + $table->setPrimaryKey(array('id'), 'pk_ezplity_id'); |
|
87 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code'); |
|
88 | + $table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status'); |
|
89 | + $table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label'); |
|
90 | + $table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code'); |
|
91 | 91 | |
92 | 92 | return $schema; |
93 | 93 | }, |
94 | 94 | |
95 | - 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
96 | - |
|
97 | - $table = $schema->createTable( 'ezuser_list' ); |
|
98 | - |
|
99 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
100 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
101 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
102 | - $table->addColumn( 'typeid', 'integer', array() ); |
|
103 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
104 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
105 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
106 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
107 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
108 | - $table->addColumn( 'pos', 'integer', array() ); |
|
109 | - $table->addColumn( 'status', 'smallint', array() ); |
|
110 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
111 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
112 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
113 | - |
|
114 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
115 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
116 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
117 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
118 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
119 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
120 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
121 | - |
|
122 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
123 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
124 | - |
|
125 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
126 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
95 | + 'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
96 | + |
|
97 | + $table = $schema->createTable('ezuser_list'); |
|
98 | + |
|
99 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
100 | + $table->addColumn('parentid', 'integer', array()); |
|
101 | + $table->addColumn('siteid', 'integer', array()); |
|
102 | + $table->addColumn('typeid', 'integer', array()); |
|
103 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
104 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
105 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
106 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
107 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
108 | + $table->addColumn('pos', 'integer', array()); |
|
109 | + $table->addColumn('status', 'smallint', array()); |
|
110 | + $table->addColumn('mtime', 'datetime', array()); |
|
111 | + $table->addColumn('ctime', 'datetime', array()); |
|
112 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
113 | + |
|
114 | + $table->setPrimaryKey(array('id'), 'pk_ezpli_id'); |
|
115 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid'); |
|
116 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end'); |
|
117 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid'); |
|
118 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start'); |
|
119 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end'); |
|
120 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos'); |
|
121 | + |
|
122 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
123 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid'); |
|
124 | + |
|
125 | + $table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'), |
|
126 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid'); |
|
127 | 127 | |
128 | 128 | return $schema; |
129 | 129 | }, |
@@ -14,31 +14,31 @@ |
||
14 | 14 | */ |
15 | 15 | class TablesCreateEzpublish extends \Aimeos\MW\Setup\Task\TablesCreateMShop |
16 | 16 | { |
17 | - /** |
|
18 | - * Returns the list of task names which depends on this task. |
|
19 | - * |
|
20 | - * @return array List of task names |
|
21 | - */ |
|
22 | - public function getPostDependencies() |
|
23 | - { |
|
24 | - return array( 'MShopAddTypeData' ); |
|
25 | - } |
|
26 | - |
|
27 | - |
|
28 | - /** |
|
29 | - * Migrate database schema |
|
30 | - */ |
|
31 | - public function migrate() |
|
32 | - { |
|
33 | - $this->msg( 'Creating Aimeos ezPublish tables', 0 ); |
|
34 | - $this->status( '' ); |
|
35 | - |
|
36 | - $ds = DIRECTORY_SEPARATOR; |
|
37 | - |
|
38 | - $files = array( |
|
39 | - 'db-customer' => __DIR__ . $ds . 'default' . $ds . 'schema' . $ds . 'customer.php', |
|
40 | - ); |
|
41 | - |
|
42 | - $this->setupSchema( $files ); |
|
43 | - } |
|
17 | + /** |
|
18 | + * Returns the list of task names which depends on this task. |
|
19 | + * |
|
20 | + * @return array List of task names |
|
21 | + */ |
|
22 | + public function getPostDependencies() |
|
23 | + { |
|
24 | + return array( 'MShopAddTypeData' ); |
|
25 | + } |
|
26 | + |
|
27 | + |
|
28 | + /** |
|
29 | + * Migrate database schema |
|
30 | + */ |
|
31 | + public function migrate() |
|
32 | + { |
|
33 | + $this->msg( 'Creating Aimeos ezPublish tables', 0 ); |
|
34 | + $this->status( '' ); |
|
35 | + |
|
36 | + $ds = DIRECTORY_SEPARATOR; |
|
37 | + |
|
38 | + $files = array( |
|
39 | + 'db-customer' => __DIR__ . $ds . 'default' . $ds . 'schema' . $ds . 'customer.php', |
|
40 | + ); |
|
41 | + |
|
42 | + $this->setupSchema( $files ); |
|
43 | + } |
|
44 | 44 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPostDependencies() |
23 | 23 | { |
24 | - return array( 'MShopAddTypeData' ); |
|
24 | + return array('MShopAddTypeData'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function migrate() |
32 | 32 | { |
33 | - $this->msg( 'Creating Aimeos ezPublish tables', 0 ); |
|
34 | - $this->status( '' ); |
|
33 | + $this->msg('Creating Aimeos ezPublish tables', 0); |
|
34 | + $this->status(''); |
|
35 | 35 | |
36 | 36 | $ds = DIRECTORY_SEPARATOR; |
37 | 37 | |
38 | 38 | $files = array( |
39 | - 'db-customer' => __DIR__ . $ds . 'default' . $ds . 'schema' . $ds . 'customer.php', |
|
39 | + 'db-customer' => __DIR__.$ds.'default'.$ds.'schema'.$ds.'customer.php', |
|
40 | 40 | ); |
41 | 41 | |
42 | - $this->setupSchema( $files ); |
|
42 | + $this->setupSchema($files); |
|
43 | 43 | } |
44 | 44 | } |
@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | return array( |
9 | - 'groups' => array( |
|
10 | - 'ansi' => ' |
|
9 | + 'groups' => array( |
|
10 | + 'ansi' => ' |
|
11 | 11 | SELECT "contentobject_id", "role_id" |
12 | 12 | FROM "ezuser_role" |
13 | 13 | WHERE :cond AND "role_id" IS NOT NULL |
14 | 14 | GROUP BY "contentobject_id", "role_id" |
15 | 15 | ' |
16 | - ), |
|
17 | - 'search' => array( |
|
18 | - 'ansi' => ' |
|
16 | + ), |
|
17 | + 'search' => array( |
|
18 | + 'ansi' => ' |
|
19 | 19 | SELECT ezro."id" AS "customer.group.id", ezro."id" AS "customer.group.code", |
20 | 20 | ezro."name" AS "customer.group.label" |
21 | 21 | FROM "ezrole" AS ezro |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | /*-orderby*/ ORDER BY :order /*orderby-*/ |
26 | 26 | LIMIT :size OFFSET :start |
27 | 27 | ' |
28 | - ), |
|
29 | - 'count' => array( |
|
30 | - 'ansi' => ' |
|
28 | + ), |
|
29 | + 'count' => array( |
|
30 | + 'ansi' => ' |
|
31 | 31 | SELECT COUNT(*) AS "count" |
32 | 32 | FROM ( |
33 | 33 | SELECT DISTINCT ezro."id" |
@@ -37,5 +37,5 @@ discard block |
||
37 | 37 | LIMIT 10000 OFFSET 0 |
38 | 38 | ) AS list |
39 | 39 | ' |
40 | - ), |
|
40 | + ), |
|
41 | 41 | ); |