@@ -8,215 +8,215 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'users' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | - |
|
13 | - $table = $schema->createTable( 'users' ); |
|
14 | - |
|
15 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
16 | - $table->addColumn( 'superuser', 'smallint', array( 'default' => 0 ) ); |
|
17 | - $table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) ); |
|
18 | - $table->addColumn( 'label', 'string', array( 'length' => 255, 'default' => '' ) ); |
|
19 | - $table->addColumn( 'name', 'string', array( 'length' => 255 ) ); |
|
20 | - $table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) ); |
|
21 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8, 'default' => '' ) ); |
|
22 | - $table->addColumn( 'company', 'string', array( 'length' => 100, 'default' => '' ) ); |
|
23 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
24 | - $table->addColumn( 'title', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
25 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
26 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64, 'default' => '' ) ); |
|
27 | - $table->addColumn( 'address1', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
28 | - $table->addColumn( 'address2', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
29 | - $table->addColumn( 'address3', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
30 | - $table->addColumn( 'postal', 'string', array( 'length' => 16, 'default' => '' ) ); |
|
31 | - $table->addColumn( 'city', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
32 | - $table->addColumn( 'state', 'string', array( 'length' => 200, 'default' => '' ) ); |
|
33 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
34 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
35 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
36 | - $table->addColumn( 'telefax', 'string', array( 'length' => 32, 'default' => '' ) ); |
|
37 | - $table->addColumn( 'website', 'string', array( 'length' => 255, 'default' => '' ) ); |
|
38 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
39 | - $table->addColumn( 'password', 'string', array( 'length' => 255 ) ); |
|
40 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
41 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
42 | - $table->addColumn( 'birthday', 'date', array( 'notnull' => false ) ); |
|
43 | - $table->addColumn( 'vdate', 'date', array( 'notnull' => false ) ); |
|
44 | - $table->addColumn( 'status', 'smallint', array( 'default' => 1 ) ); |
|
45 | - $table->addColumn( 'updated_at', 'datetime', [] ); |
|
46 | - $table->addColumn( 'created_at', 'datetime', [] ); |
|
47 | - $table->addColumn( 'editor', 'string', array('length' => 255, 'default' => '' ) ); |
|
48 | - |
|
49 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' ); |
|
50 | - $table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' ); |
|
51 | - $table->addIndex( array( 'langid' ), 'idx_lvusr_langid' ); |
|
52 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' ); |
|
53 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' ); |
|
54 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' ); |
|
55 | - $table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' ); |
|
56 | - $table->addIndex( array( 'address1' ), 'idx_lvusr_address1' ); |
|
57 | - $table->addIndex( array( 'city' ), 'idx_lvusr_city' ); |
|
11 | + 'users' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | + |
|
13 | + $table = $schema->createTable('users'); |
|
14 | + |
|
15 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
16 | + $table->addColumn('superuser', 'smallint', array('default' => 0)); |
|
17 | + $table->addColumn('siteid', 'integer', array('notnull' => false)); |
|
18 | + $table->addColumn('label', 'string', array('length' => 255, 'default' => '')); |
|
19 | + $table->addColumn('name', 'string', array('length' => 255)); |
|
20 | + $table->addColumn('remember_token', 'string', array('length' => 100, 'notnull' => false)); |
|
21 | + $table->addColumn('salutation', 'string', array('length' => 8, 'default' => '')); |
|
22 | + $table->addColumn('company', 'string', array('length' => 100, 'default' => '')); |
|
23 | + $table->addColumn('vatid', 'string', array('length' => 32, 'default' => '')); |
|
24 | + $table->addColumn('title', 'string', array('length' => 64, 'default' => '')); |
|
25 | + $table->addColumn('firstname', 'string', array('length' => 64, 'default' => '')); |
|
26 | + $table->addColumn('lastname', 'string', array('length' => 64, 'default' => '')); |
|
27 | + $table->addColumn('address1', 'string', array('length' => 200, 'default' => '')); |
|
28 | + $table->addColumn('address2', 'string', array('length' => 200, 'default' => '')); |
|
29 | + $table->addColumn('address3', 'string', array('length' => 200, 'default' => '')); |
|
30 | + $table->addColumn('postal', 'string', array('length' => 16, 'default' => '')); |
|
31 | + $table->addColumn('city', 'string', array('length' => 200, 'default' => '')); |
|
32 | + $table->addColumn('state', 'string', array('length' => 200, 'default' => '')); |
|
33 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
34 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
35 | + $table->addColumn('telephone', 'string', array('length' => 32, 'default' => '')); |
|
36 | + $table->addColumn('telefax', 'string', array('length' => 32, 'default' => '')); |
|
37 | + $table->addColumn('website', 'string', array('length' => 255, 'default' => '')); |
|
38 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
39 | + $table->addColumn('password', 'string', array('length' => 255)); |
|
40 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
41 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
42 | + $table->addColumn('birthday', 'date', array('notnull' => false)); |
|
43 | + $table->addColumn('vdate', 'date', array('notnull' => false)); |
|
44 | + $table->addColumn('status', 'smallint', array('default' => 1)); |
|
45 | + $table->addColumn('updated_at', 'datetime', []); |
|
46 | + $table->addColumn('created_at', 'datetime', []); |
|
47 | + $table->addColumn('editor', 'string', array('length' => 255, 'default' => '')); |
|
48 | + |
|
49 | + $table->setPrimaryKey(array('id'), 'pk_lvusr_id'); |
|
50 | + $table->addUniqueIndex(array('email'), 'unq_lvusr_email'); |
|
51 | + $table->addIndex(array('langid'), 'idx_lvusr_langid'); |
|
52 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvusr_last_first'); |
|
53 | + $table->addIndex(array('postal', 'address1'), 'idx_lvusr_post_addr1'); |
|
54 | + $table->addIndex(array('postal', 'city'), 'idx_lvusr_post_city'); |
|
55 | + $table->addIndex(array('lastname'), 'idx_lvusr_lastname'); |
|
56 | + $table->addIndex(array('address1'), 'idx_lvusr_address1'); |
|
57 | + $table->addIndex(array('city'), 'idx_lvusr_city'); |
|
58 | 58 | |
59 | 59 | return $schema; |
60 | 60 | }, |
61 | 61 | |
62 | - 'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
63 | - |
|
64 | - $table = $schema->createTable( 'users_address' ); |
|
65 | - |
|
66 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
67 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
68 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
69 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
70 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
71 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
72 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
73 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
74 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
75 | - $table->addColumn( 'address1', 'string', array( 'length' => 200 ) ); |
|
76 | - $table->addColumn( 'address2', 'string', array( 'length' => 200 ) ); |
|
77 | - $table->addColumn( 'address3', 'string', array( 'length' => 200 ) ); |
|
78 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
79 | - $table->addColumn( 'city', 'string', array( 'length' => 200 ) ); |
|
80 | - $table->addColumn( 'state', 'string', array( 'length' => 200 ) ); |
|
81 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
82 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
83 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
84 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
85 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
86 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
87 | - $table->addColumn( 'longitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
88 | - $table->addColumn( 'latitude', 'decimal', array( 'precision' => 8, 'scale' => 6, 'notnull' => false ) ); |
|
89 | - $table->addColumn( 'flag', 'integer', [] ); |
|
90 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
91 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
92 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
93 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
94 | - |
|
95 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' ); |
|
96 | - $table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' ); |
|
97 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' ); |
|
98 | - $table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' ); |
|
99 | - $table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' ); |
|
100 | - $table->addIndex( array( 'address1' ), 'idx_lvuad_address1' ); |
|
101 | - $table->addIndex( array( 'city' ), 'idx_lvuad_city' ); |
|
102 | - $table->addIndex( array( 'email' ), 'idx_lvuad_email' ); |
|
103 | - |
|
104 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
105 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuad_pid' ); |
|
62 | + 'users_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
63 | + |
|
64 | + $table = $schema->createTable('users_address'); |
|
65 | + |
|
66 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
67 | + $table->addColumn('siteid', 'integer', []); |
|
68 | + $table->addColumn('parentid', 'integer', []); |
|
69 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
70 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
71 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
72 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
73 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
74 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
75 | + $table->addColumn('address1', 'string', array('length' => 200)); |
|
76 | + $table->addColumn('address2', 'string', array('length' => 200)); |
|
77 | + $table->addColumn('address3', 'string', array('length' => 200)); |
|
78 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
79 | + $table->addColumn('city', 'string', array('length' => 200)); |
|
80 | + $table->addColumn('state', 'string', array('length' => 200)); |
|
81 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
82 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
83 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
84 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
85 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
86 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
87 | + $table->addColumn('longitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
88 | + $table->addColumn('latitude', 'decimal', array('precision' => 8, 'scale' => 6, 'notnull' => false)); |
|
89 | + $table->addColumn('flag', 'integer', []); |
|
90 | + $table->addColumn('pos', 'smallint', []); |
|
91 | + $table->addColumn('mtime', 'datetime', []); |
|
92 | + $table->addColumn('ctime', 'datetime', []); |
|
93 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
94 | + |
|
95 | + $table->setPrimaryKey(array('id'), 'pk_lvuad_id'); |
|
96 | + $table->addIndex(array('parentid'), 'idx_lvuad_pid'); |
|
97 | + $table->addIndex(array('lastname', 'firstname'), 'idx_lvuad_last_first'); |
|
98 | + $table->addIndex(array('postal', 'address1'), 'idx_lvuad_post_addr1'); |
|
99 | + $table->addIndex(array('postal', 'city'), 'idx_lvuad_post_city'); |
|
100 | + $table->addIndex(array('address1'), 'idx_lvuad_address1'); |
|
101 | + $table->addIndex(array('city'), 'idx_lvuad_city'); |
|
102 | + $table->addIndex(array('email'), 'idx_lvuad_email'); |
|
103 | + |
|
104 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
105 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuad_pid'); |
|
106 | 106 | |
107 | 107 | return $schema; |
108 | 108 | }, |
109 | 109 | |
110 | - 'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
110 | + 'users_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
111 | 111 | |
112 | - $table = $schema->createTable( 'users_list_type' ); |
|
112 | + $table = $schema->createTable('users_list_type'); |
|
113 | 113 | |
114 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
115 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
116 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
117 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
118 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
119 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
120 | - $table->addColumn( 'status', 'smallint', [] ); |
|
121 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
122 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
123 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
114 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
115 | + $table->addColumn('siteid', 'integer', []); |
|
116 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
117 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
118 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
119 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
120 | + $table->addColumn('status', 'smallint', []); |
|
121 | + $table->addColumn('mtime', 'datetime', []); |
|
122 | + $table->addColumn('ctime', 'datetime', []); |
|
123 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
124 | 124 | |
125 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' ); |
|
126 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' ); |
|
127 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvulity_sid_status_pos' ); |
|
128 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' ); |
|
129 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' ); |
|
125 | + $table->setPrimaryKey(array('id'), 'pk_lvulity_id'); |
|
126 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvulity_sid_dom_code'); |
|
127 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvulity_sid_status_pos'); |
|
128 | + $table->addIndex(array('siteid', 'label'), 'idx_lvulity_sid_label'); |
|
129 | + $table->addIndex(array('siteid', 'code'), 'idx_lvulity_sid_code'); |
|
130 | 130 | |
131 | 131 | return $schema; |
132 | 132 | }, |
133 | 133 | |
134 | - 'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
135 | - |
|
136 | - $table = $schema->createTable( 'users_list' ); |
|
137 | - |
|
138 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
139 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
140 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
141 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
142 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
143 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
144 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
145 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
146 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
147 | - $table->addColumn( 'pos', 'integer', [] ); |
|
148 | - $table->addColumn( 'status', 'smallint', [] ); |
|
149 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
150 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
151 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
152 | - |
|
153 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' ); |
|
154 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_lvuli_sid_dm_rid_tid_pid' ); |
|
155 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_lvuli_sid_stat_start_end' ); |
|
156 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_lvuli_pid_sid_rid_dom_tid' ); |
|
157 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_lvuli_pid_sid_start' ); |
|
158 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_lvuli_pid_sid_end' ); |
|
159 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_lvuli_pid_sid_pos' ); |
|
160 | - |
|
161 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
162 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_pid' ); |
|
163 | - |
|
164 | - $table->addForeignKeyConstraint( 'users_list_type', array( 'typeid' ), array( 'id' ), |
|
165 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_typeid' ); |
|
134 | + 'users_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
135 | + |
|
136 | + $table = $schema->createTable('users_list'); |
|
137 | + |
|
138 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
139 | + $table->addColumn('parentid', 'integer', []); |
|
140 | + $table->addColumn('siteid', 'integer', []); |
|
141 | + $table->addColumn('typeid', 'integer', []); |
|
142 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
143 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
144 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
145 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
146 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
147 | + $table->addColumn('pos', 'integer', []); |
|
148 | + $table->addColumn('status', 'smallint', []); |
|
149 | + $table->addColumn('mtime', 'datetime', []); |
|
150 | + $table->addColumn('ctime', 'datetime', []); |
|
151 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
152 | + |
|
153 | + $table->setPrimaryKey(array('id'), 'pk_lvuli_id'); |
|
154 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_lvuli_sid_dm_rid_tid_pid'); |
|
155 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_lvuli_sid_stat_start_end'); |
|
156 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_lvuli_pid_sid_rid_dom_tid'); |
|
157 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_lvuli_pid_sid_start'); |
|
158 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_lvuli_pid_sid_end'); |
|
159 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_lvuli_pid_sid_pos'); |
|
160 | + |
|
161 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
162 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_pid'); |
|
163 | + |
|
164 | + $table->addForeignKeyConstraint('users_list_type', array('typeid'), array('id'), |
|
165 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvuli_typeid'); |
|
166 | 166 | |
167 | 167 | return $schema; |
168 | 168 | }, |
169 | 169 | |
170 | - 'users_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
170 | + 'users_property_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
171 | 171 | |
172 | - $table = $schema->createTable( 'users_property_type' ); |
|
172 | + $table = $schema->createTable('users_property_type'); |
|
173 | 173 | |
174 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
175 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
176 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
177 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
178 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
179 | - $table->addColumn( 'pos', 'integer', ['default' => 0] ); |
|
180 | - $table->addColumn( 'status', 'smallint', [] ); |
|
181 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
182 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
183 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
174 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
175 | + $table->addColumn('siteid', 'integer', []); |
|
176 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
177 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
178 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
179 | + $table->addColumn('pos', 'integer', ['default' => 0]); |
|
180 | + $table->addColumn('status', 'smallint', []); |
|
181 | + $table->addColumn('mtime', 'datetime', []); |
|
182 | + $table->addColumn('ctime', 'datetime', []); |
|
183 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
184 | 184 | |
185 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvuprty_id' ); |
|
186 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvuprty_sid_dom_code' ); |
|
187 | - $table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvuprty_sid_status_pos' ); |
|
188 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_lvuprty_sid_label' ); |
|
189 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_lvuprty_sid_code' ); |
|
185 | + $table->setPrimaryKey(array('id'), 'pk_lvuprty_id'); |
|
186 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_lvuprty_sid_dom_code'); |
|
187 | + $table->addIndex(array('siteid', 'status', 'pos'), 'idx_lvuprty_sid_status_pos'); |
|
188 | + $table->addIndex(array('siteid', 'label'), 'idx_lvuprty_sid_label'); |
|
189 | + $table->addIndex(array('siteid', 'code'), 'idx_lvuprty_sid_code'); |
|
190 | 190 | |
191 | 191 | return $schema; |
192 | 192 | }, |
193 | 193 | |
194 | - 'users_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
194 | + 'users_property' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
195 | 195 | |
196 | - $table = $schema->createTable( 'users_property' ); |
|
196 | + $table = $schema->createTable('users_property'); |
|
197 | 197 | |
198 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
199 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
200 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
201 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
202 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
203 | - $table->addColumn( 'value', 'string', array( 'length' => 255 ) ); |
|
204 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
205 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
206 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
198 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
199 | + $table->addColumn('siteid', 'integer', []); |
|
200 | + $table->addColumn('parentid', 'integer', []); |
|
201 | + $table->addColumn('typeid', 'integer', []); |
|
202 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
203 | + $table->addColumn('value', 'string', array('length' => 255)); |
|
204 | + $table->addColumn('mtime', 'datetime', []); |
|
205 | + $table->addColumn('ctime', 'datetime', []); |
|
206 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
207 | 207 | |
208 | - $table->setPrimaryKey( array( 'id' ), 'pk_lvupr_id' ); |
|
209 | - $table->addUniqueIndex( array( 'parentid', 'siteid', 'typeid', 'langid', 'value' ), 'unq_lvupr_sid_tid_lid_value' ); |
|
210 | - $table->addIndex( array( 'siteid', 'langid' ), 'idx_lvupr_sid_langid' ); |
|
211 | - $table->addIndex( array( 'siteid', 'value' ), 'idx_lvupr_sid_value' ); |
|
212 | - $table->addIndex( array( 'typeid' ), 'fk_lvupr_typeid' ); |
|
213 | - $table->addIndex( array( 'parentid' ), 'fk_lvupr_pid' ); |
|
208 | + $table->setPrimaryKey(array('id'), 'pk_lvupr_id'); |
|
209 | + $table->addUniqueIndex(array('parentid', 'siteid', 'typeid', 'langid', 'value'), 'unq_lvupr_sid_tid_lid_value'); |
|
210 | + $table->addIndex(array('siteid', 'langid'), 'idx_lvupr_sid_langid'); |
|
211 | + $table->addIndex(array('siteid', 'value'), 'idx_lvupr_sid_value'); |
|
212 | + $table->addIndex(array('typeid'), 'fk_lvupr_typeid'); |
|
213 | + $table->addIndex(array('parentid'), 'fk_lvupr_pid'); |
|
214 | 214 | |
215 | - $table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ), |
|
216 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_pid' ); |
|
215 | + $table->addForeignKeyConstraint('users', array('parentid'), array('id'), |
|
216 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_pid'); |
|
217 | 217 | |
218 | - $table->addForeignKeyConstraint( 'users_property_type', array( 'typeid' ), array( 'id' ), |
|
219 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_typeid' ); |
|
218 | + $table->addForeignKeyConstraint('users_property_type', array('typeid'), array('id'), |
|
219 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_lvupr_typeid'); |
|
220 | 220 | |
221 | 221 | return $schema; |
222 | 222 | }, |