File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
+ * @copyright Aimeos (aimeos.org), 2021-2023
6
+ */
7
+
8
+
9
+ namespace Aimeos \Upscheme \Task ;
10
+
11
+
12
+ class Emoji extends Base
13
+ {
14
+ public function up ()
15
+ {
16
+ $ this ->info ( 'Creating emoji schema ' , 'vv ' );
17
+ $ db = $ this ->db ( 'db-emoji ' );
18
+
19
+ foreach ( $ this ->paths ( 'default/schema/emoji.php ' ) as $ filepath )
20
+ {
21
+ if ( ( $ list = include ( $ filepath ) ) === false ) {
22
+ throw new \RuntimeException ( sprintf ( 'Unable to get schema from file "%1$s" ' , $ filepath ) );
23
+ }
24
+
25
+ foreach ( $ list ['table ' ] ?? [] as $ name => $ fcn ) {
26
+ $ db ->table ( $ name , $ fcn );
27
+ }
28
+ }
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
+ * @copyright Aimeos (aimeos.org), 2016-2023
6
+ */
7
+
8
+
9
+ return array (
10
+ 'table ' => array (
11
+
12
+ 'mshop_emoji ' => function ( \Aimeos \Upscheme \Schema \Table $ table ) {
13
+ $ table ->engine = 'InnoDB ' ;
14
+ $ table ->id ();
15
+ $ table ->string ( 'code ' );
16
+ $ table ->string ( 'label ' )->default ( '' );
17
+ $ table ->smallInteger ( 'status ' )->default ( 1 );
18
+ $ table ->index ( ['status ' , 'code ' ], 'idx_msemoj_load ' );
19
+ },
20
+
21
+ 'mshop_emoji_user_product_relation ' => function ( \Aimeos \Upscheme \Schema \Table $ table ) {
22
+ $ table ->engine = 'InnoDB ' ;
23
+ $ table ->id ();
24
+ $ table ->string ( 'product_id ' );
25
+ $ table ->integer ( 'user_id ' );
26
+ $ table ->integer ( 'emoji_id ' );
27
+ },
28
+ )
29
+ );
You can’t perform that action at this time.
0 commit comments