/**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     /** Tables generation **/
     $this->createOroUserEmailTable($schema);
     $this->createOroUserApiTable($schema);
     $this->createOroUserTable($schema);
     UserAvatars::addAvatarToUser($schema, $this->attachmentExtension);
     UserAvatars::addOwnerToOroFile($schema);
     AttachmentOwner::addOwnerToAttachment($schema);
     $this->createOroUserAccessRoleTable($schema);
     $this->createOroUserAccessGroupTable($schema);
     $this->createOroUserBusinessUnitTable($schema);
     $this->createOroUserEmailOriginTable($schema);
     $this->createOroAccessGroupTable($schema);
     $this->createOroUserAccessGroupRoleTable($schema);
     $this->createOroAccessRoleTable($schema);
     $this->createOroSessionTable($schema);
     $this->createOroUserStatusTable($schema);
     /** Foreign keys generation **/
     $this->addOroUserEmailForeignKeys($schema);
     $this->addOroUserApiForeignKeys($schema);
     $this->addOroUserForeignKeys($schema);
     $this->addOroUserAccessRoleForeignKeys($schema);
     $this->addOroUserAccessGroupForeignKeys($schema);
     $this->addOroUserBusinessUnitForeignKeys($schema);
     $this->addOroUserEmailOriginForeignKeys($schema);
     $this->addOroAccessGroupForeignKeys($schema);
     $this->addOroUserAccessGroupRoleForeignKeys($schema);
     $this->addOroUserStatusForeignKeys($schema);
     EmailTemplateOwner::addOwnerToOroEmailTemplate($schema);
     OroUserBundle::addOwnerToOroEmailAddress($schema);
     UserEmailActivities::addActivityAssociations($schema, $this->activityExtension);
     UserOrganization::addOrganizationFields($schema);
     UserOrganization::oroUserOrganizationTable($schema);
     UserOrganization::oroUserOrganizationForeignKeys($schema);
 }
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     /** Tables generation **/
     $this->createOroUserEmailTable($schema);
     $this->createOroUserApiTable($schema);
     $this->createOroUserTable($schema);
     UserAvatars::addAvatarToUser($schema, $this->attachmentExtension);
     UserAvatars::addOwnerToOroFile($schema);
     AttachmentOwner::addOwnerToAttachment($schema);
     $this->createOroUserAccessRoleTable($schema);
     $this->createOroUserAccessGroupTable($schema);
     $this->createOroUserBusinessUnitTable($schema);
     $this->createOroAccessGroupTable($schema);
     $this->createOroUserAccessGroupRoleTable($schema);
     $this->createOroAccessRoleTable($schema);
     $this->createOroUserStatusTable($schema);
     /** Foreign keys generation **/
     $this->addOroUserEmailForeignKeys($schema);
     $this->addOroUserApiForeignKeys($schema);
     $this->addOroUserForeignKeys($schema);
     $this->addOroUserAccessRoleForeignKeys($schema);
     $this->addOroUserAccessGroupForeignKeys($schema);
     $this->addOroUserBusinessUnitForeignKeys($schema);
     $this->addOroAccessGroupForeignKeys($schema);
     $this->addOroUserAccessGroupRoleForeignKeys($schema);
     $this->addOroUserStatusForeignKeys($schema);
     EmailTemplateOwner::addOwnerToOroEmailTemplate($schema);
     OroUserBundle::addOwnerToOroEmailAddress($schema);
     UserEmailActivities::addActivityAssociations($schema, $this->activityExtension);
     UserOrganization::addOrganizationFields($schema);
     UserOrganization::oroUserOrganizationTable($schema);
     UserOrganization::oroUserOrganizationForeignKeys($schema);
     ExtendTitle::addTitleColumn($schema);
     PasswordChanged::addPasswordChangedColumn($schema);
     $this->addOroAccessGroupIndexes($schema);
     EmailOrigin::addOwnerAndOrganizationColumns($schema);
     SetOwnerForEmail::addOwnerToOroEmail($schema);
     RemoveOldSchema::execute($schema);
     AddRelationToMailbox::createOroEmailMailboxUsersTable($schema);
     AddRelationToMailbox::createOroEmailMailboxRolesTable($schema);
     AddRelationToMailbox::addOroEmailMailboxUsersAndRolesForeignKeys($schema);
     // depends to the UserBundle
     ChangeEmailUserFolderRelation::createOroEmailUserFoldersTable($schema);
     ChangeEmailUserFolderRelation::addOroEmailUserFoldersForeignKeys($schema);
     ChangeEmailUserFolderRelation::updateOroEmailUserTable($schema);
     AddEmailUserColumn::updateOroEmailUserTable($schema);
     DropEmailUserColumn::updateOroEmailUserTable($schema);
 }