/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { $this->attachmentExtension->addFileRelation($schema, 'orocrm_partner', 'contract', 'file', [], 7); $this->attachmentExtension->addAttachmentAssociation($schema, 'orocrm_partner', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); $this->noteExtension->addNoteAssociation($schema, 'orocrm_partner'); $this->activityExtension->addActivityAssociation($schema, 'oro_email', 'orocrm_partner'); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { $this->attachmentExtension->addFileRelation($schema, 'orocrm_partner', 'contract', [], 7); $this->attachmentExtension->addAttachmentAssociation($schema, 'orocrm_partner', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); $this->noteExtension->addNoteAssociation($schema, 'orocrm_partner'); $this->activityExtension->addActivityAssociation($schema, 'oro_email', 'orocrm_partner'); $this->activityExtension->addActivityAssociation($schema, 'orocrm_partner_github_issue', 'orocrm_partner'); $this->extendExtension->addEnumField($schema, $schema->getTable('orocrm_partner_github_issue'), 'status', 'github_issue_status', false, false, ['extend' => ['owner' => ExtendScope::OWNER_CUSTOM]]); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { $migration = new OroCRMCaseBundle(); $migration->up($schema, $queries); $migration11 = new OroCRMCaseBundle11(); $migration11->up($schema, $queries); OroCRMCaseBundle12::addOrganization($schema); $this->attachmentExtension->addImageRelation($schema, 'orocrm_case_comment', 'attachment'); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { /** Tables generation **/ $this->createOrocrmAccountTable($schema); $this->createOrocrmAccountToContactTable($schema); /** Foreign keys generation **/ $this->addOrocrmAccountForeignKeys($schema); $this->addOrocrmAccountToContactForeignKeys($schema); $this->noteExtension->addNoteAssociation($schema, 'orocrm_account'); $this->activityExtension->addActivityAssociation($schema, 'oro_email', 'orocrm_account'); $this->attachmentExtension->addAttachmentAssociation($schema, 'orocrm_account', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); }
/** * Create orob2b_order table * * @param Schema $schema */ protected function createOroB2BOrderTable(Schema $schema) { $table = $schema->createTable('orob2b_order'); $table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('organization_id', 'integer', ['notnull' => false]); $table->addColumn('user_owner_id', 'integer', ['notnull' => false]); $table->addColumn('shipping_address_id', 'integer', ['notnull' => false]); $table->addColumn('billing_address_id', 'integer', ['notnull' => false]); $table->addColumn('price_list_id', 'integer', ['notnull' => false]); $table->addColumn('identifier', 'string', ['notnull' => false, 'length' => 255]); $table->addColumn('created_at', 'datetime', ['comment' => '(DC2Type:datetime)']); $table->addColumn('updated_at', 'datetime', ['comment' => '(DC2Type:datetime)']); $table->addColumn('po_number', 'string', ['notnull' => false, 'length' => 255]); $table->addColumn('customer_notes', 'text', ['notnull' => false]); $table->addColumn('ship_until', 'date', ['notnull' => false]); $table->addColumn('currency', 'string', ['notnull' => false, 'length' => 3]); $table->addColumn('subtotal', 'money', ['notnull' => false, 'precision' => 19, 'scale' => 4, 'comment' => '(DC2Type:money)']); $table->addColumn('payment_term_id', 'integer', ['notnull' => false]); $table->addColumn('account_id', 'integer', []); $table->addColumn('account_user_id', 'integer', ['notnull' => false]); $table->setPrimaryKey(['id']); $table->addIndex(['created_at'], 'orob2b_order_created_at_index', []); $table->addUniqueIndex(['identifier'], 'uniq_orob2b_order_identifier'); $table->addUniqueIndex(['shipping_address_id'], 'uniq_c036ff904d4cff2b'); $table->addUniqueIndex(['billing_address_id'], 'uniq_c036ff9079d0c0e4'); $this->noteExtension->addNoteAssociation($schema, $table->getName()); $this->attachmentExtension->addAttachmentAssociation($schema, $table->getName()); $this->activityExtension->addActivityAssociation($schema, 'oro_calendar_event', $table->getName()); $this->activityExtension->addActivityAssociation($schema, 'oro_email', $table->getName()); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { /** Tables generation **/ $this->createOrocrmAccountTable($schema); $this->createOrocrmAccountToContactTable($schema); /** Foreign keys generation **/ $this->addOrocrmAccountForeignKeys($schema); $this->addOrocrmAccountToContactForeignKeys($schema); $this->noteExtension->addNoteAssociation($schema, 'orocrm_account'); $this->activityExtension->addActivityAssociation($schema, 'oro_email', 'orocrm_account'); $this->activityExtension->addActivityAssociation($schema, 'oro_calendar_event', 'orocrm_account'); $this->attachmentExtension->addAttachmentAssociation($schema, 'orocrm_account', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); InheritanceActivityTargets::addInheritanceTargets($schema, $this->activityListExtension); // update to 1.8 $addReferredBy = new AddReferredBy(); $addReferredBy->up($schema, $queries); }
/** * Add orocrm_case_comment foreign keys. * * @param Schema $schema */ protected function addOrocrmCaseCommentForeignKeys(Schema $schema) { $table = $schema->getTable('orocrm_case_comment'); $table->addForeignKeyConstraint($schema->getTable('orocrm_case'), ['case_id'], ['id'], ['onDelete' => 'CASCADE', 'onUpdate' => null]); $table->addForeignKeyConstraint($schema->getTable('oro_user'), ['updated_by_id'], ['id'], ['onDelete' => 'SET NULL', 'onUpdate' => null]); $table->addForeignKeyConstraint($schema->getTable('oro_user'), ['owner_id'], ['id'], ['onDelete' => 'SET NULL', 'onUpdate' => null]); $table->addForeignKeyConstraint($schema->getTable('orocrm_contact'), ['contact_id'], ['id'], ['onDelete' => 'SET NULL', 'onUpdate' => null]); $table->addForeignKeyConstraint($schema->getTable('oro_organization'), ['organization_id'], ['id'], ['onDelete' => 'SET NULL', 'onUpdate' => null]); $this->attachmentExtension->addFileRelation($schema, 'orocrm_case_comment', 'attachment'); }
/** * Create orob2b_customer table * * @param Schema $schema */ protected function createOroB2BCustomerTable(Schema $schema) { $table = $schema->createTable(static::ORO_B2B_CUSTOMER_TABLE_NAME); $table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('name', 'string', ['length' => 255]); $table->addColumn('parent_id', 'integer', ['notnull' => false]); $table->addColumn('group_id', 'integer', ['notnull' => false]); $table->addColumn('organization_id', 'integer', ['notnull' => false]); $table->setPrimaryKey(['id']); $table->addIndex(['name'], 'orob2b_customer_name_idx', []); $this->attachmentExtension->addAttachmentAssociation($schema, static::ORO_B2B_CUSTOMER_TABLE_NAME, ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation']); $this->noteExtension->addNoteAssociation($schema, static::ORO_B2B_CUSTOMER_TABLE_NAME); $this->extendExtension->addEnumField($schema, static::ORO_B2B_CUSTOMER_TABLE_NAME, 'internal_rating', Customer::INTERNAL_RATING_CODE); }
/** * @param Schema $schema * @param AttachmentExtension $attachmentExtension */ public static function addAvatarToUser(Schema $schema, AttachmentExtension $attachmentExtension) { $attachmentExtension->addImageRelation($schema, 'oro_user', 'avatar', [], 2, 58, 58); }
/** * Enable Attachment for Quote entity * * @param Schema $schema * @param AttachmentExtension $attachmentExtension */ protected function addAttachmentAssociations(Schema $schema, AttachmentExtension $attachmentExtension) { $attachmentExtension->addAttachmentAssociation($schema, 'orob2b_sale_quote', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); }
/** * @param Schema $schema * @param AttachmentExtension $attachmentExtension */ public static function addPhotoToContact(Schema $schema, AttachmentExtension $attachmentExtension) { $attachmentExtension->addImageRelation($schema, 'orocrm_contact', 'picture', [], 2, 58, 58); }
/** * @param Schema $schema * @param AttachmentExtension $attachmentExtension */ public static function addAttachment(Schema $schema, AttachmentExtension $attachmentExtension) { $attachmentExtension->addFileRelation($schema, 'oro_comment', 'attachment'); }
/** * @param Schema $schema */ protected function addAttachmentAssociations(Schema $schema) { $this->attachmentExtension->addImageRelation($schema, self::PRODUCT_TABLE_NAME, 'image', [], self::MAX_PRODUCT_IMAGE_SIZE_IN_MB); $this->attachmentExtension->addAttachmentAssociation($schema, self::PRODUCT_TABLE_NAME, [], self::MAX_PRODUCT_ATTACHMENT_SIZE_IN_MB); }
public function up(Schema $schema, QueryBag $queries) { $this->attachmentExtension->addAttachmentAssociation($schema, 'orocrm_account', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); }
/** * @param Schema $schema */ protected function addImageAssociations(Schema $schema) { $this->attachmentExtension->addImageRelation($schema, self::CMS_LOGIN_PAGE_TABLE, 'logoImage', [], self::MAX_LOGO_IMAGE_SIZE_IN_MB); $this->attachmentExtension->addImageRelation($schema, self::CMS_LOGIN_PAGE_TABLE, 'backgroundImage', [], self::MAX_BACKGROUND_IMAGE_SIZE_IN_MB); }
/** * Add Attachment for Opportunity. * * @param Schema $schema * @param AttachmentExtension $attachmentExtension */ public static function addOpportunityAttachment(Schema $schema, AttachmentExtension $attachmentExtension) { $attachmentExtension->addAttachmentAssociation($schema, 'orocrm_sales_opportunity', ['image/*', 'application/pdf', 'application/zip', 'application/x-gzip', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'], 2); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { $this->attachmentExtension->addFileRelation($schema, 'orocrm_case_comment', 'attachment'); }
/** * {@inheritdoc} */ public function up(Schema $schema, QueryBag $queries) { $this->attachmentExtension->addAttachmentAssociation($schema, 'ms_letter', [], 5); }
/** * Enable attachments for Order entity * * @param Schema $schema */ public function addAttachmentAssociations(Schema $schema) { $this->attachmentExtension->addAttachmentAssociation($schema, self::ORDER_TABLE_NAME); }