table('product_photos', ['id' => false, 'primary_key' => ['id']]); $table->addColumn('id', 'uuid', [ 'default' => null, 'null' => false, ]); $table->addColumn('product_id', 'uuid', [ 'default' => null, 'null' => false, ]); $table->addColumn('product_sku_id', 'uuid', [ 'default' => null, 'null' => true, ]); $table->addColumn('photo_dir', 'text', [ 'default' => null, 'length' => 255, 'null' => false, ]); $table->addColumn('photo_filename', 'string', [ 'default' => null, 'length' => 255, 'null' => false, ]); $table->addColumn('primary_photo', 'boolean', [ 'default' => false, 'null' => false, ]); $table->addColumn('photo_position', 'integer', [ 'default' => 100, 'limit' => 11, 'null' => false, ]); $table->addColumn('enabled', 'boolean', [ 'default' => false, 'null' => false, ]); $table->addColumn('created', 'datetime', [ 'default' => null, 'null' => false, ]); $table->addColumn('modified', 'datetime', [ 'default' => null, 'null' => true, ]); $table->addColumn('deleted', 'datetime', [ 'default' => null, 'null' => true, ]); $table->addIndex([ 'product_id', ], [ 'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_ID', 'unique' => false, ]); $table->addIndex([ 'product_sku_id', ], [ 'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_SKU_ID', 'unique' => true, ]); $table->create(); } }